
    /;ji?                         d dl Z ddlmZ ddlmZmZ ddlmZmZmZm	Z	 dede
fdZdde
d
ede	fdZdededdfdZdded
ede	fdZdS )    N   )msgpack)msgpack_encodersmsgpack_decoders)
force_pathFilePathJSONInputBinJSONOutputBindatareturnc                 .    t          j        | d          S )zSerialize an object to a msgpack byte string.

    data: The data to serialize.
    RETURNS (bytes): The serialized bytes.
    Tuse_bin_type)r   dumps)r   s    L/root/voice-cloning/.venv/lib/python3.11/site-packages/srsly/_msgpack_api.pymsgpack_dumpsr      s     =D1111    Tuse_listc                     t          j                     t          j        | d|          }t          j                     |S )zDeserialize msgpack bytes to a Python object.

    data (bytes): The data to deserialize.
    use_list (bool): Don't use tuples instead of lists. Can make
        deserialization slower.
    RETURNS: The deserialized Python object.
    Frawr   )gcdisabler   loadsenable)r   r   msgs      r   msgpack_loadsr      s5     JLLL
-%(
;
;
;CIKKKJr   pathc                     t          | d          }|                    d          5 }t          j        ||d           ddd           dS # 1 swxY w Y   dS )zCreate a msgpack file and dump contents.

    location (FilePath): The file path.
    data (JSONInputBin): The data to serialize.
    F)require_existswbTr   N)r   openr   dump)r   r   	file_pathfs       r   write_msgpackr&       s     4666I			 1T1400001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1s   AAAc                     t          |           }|                    d          5 }t          j                     t	          j        |d|          }t          j                     |cddd           S # 1 swxY w Y   dS )zLoad a msgpack file.

    location (FilePath): The file path.
    use_list (bool): Don't use tuples instead of lists. Can make
        deserialization slower.
    RETURNS (JSONOutputBin): The loaded and deserialized content.
    rbFr   N)r   r"   r   r   r   loadr   )r   r   r$   r%   r   s        r   read_msgpackr*   +   s     4  I			 

l1%(;;;
	                 s   ?A11A58A5)T)r    r   r   r   utilr   r   r	   r
   bytesr   boolr   r&   r*    r   r   <module>r0      s   				       7 7 7 7 7 7 7 7 C C C C C C C C C C C C2 2 2 2 2 2       1 1 1 1 1 1 1 x 4 =      r   