
    YV.jw                     n   U d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZmZmZmZmZmZmZmZmZmZ d dlmZ d dlmZ ddlmZ ddlmZ dZ e j<                  d	e j>                  e j@                  
       eee!e"f   ee!e"ee"ef   f   f   Z#ee$d<   ee#   Z%ee$d<    G d de      Z&y)    N)
AnyCallableDictListOptionalSequenceSetTupleTypeUnion)	TypeAlias)UnsupportedFeature   )BaseProvider)	TypesSpecT	faker-csv)quoting
ColumnSpecDataColumnsc                      e Zd Zd6dedefdZdee   fdZd7dedefdZ	d8dede
eef   fdZd8dede
eef   fd	Zd8dede
eef   fd
Zefdee
eej"                  gef   eej"                  gef   f      de
eeej"                  f   fdZ	 	 	 	 	 d9dedededededefdZ	 	 	 	 d:dedededee   def
dZ	 	 	 	 d:dedededee   def
dZ	 	 	 	 d;deeef   dedee
eee   ef      dee   def
dZ	 	 	 	 	 d<dedeee      d eeef   d!ed"ed#edefd$Z	 	 	 	 d=deee      d eeef   d!ed"edef
d%Z	 	 	 	 d=deee      d eeef   d!ed"edef
d&Z	 	 	 	 d=deee      d eeef   d!ed"edef
d'Z	 	 	 	 d>d ee   d!ed(ee   d)eee jB                        def
d*Z"	 	 	 	 d>d ee   d!ed(ee   d)eee jB                        def
d+Z 	 	 	 	 d?d,ed-ed.ee#   d/ee#   def
d0Z$d@d ee%   d!ed1edefd2Z&d3ed4ede
eef   fd5Z'y)AProviderchance_of_getting_truereturnc                 T    | j                   j                  j                  dd      |k  S )zGenerate a random boolean value based on ``chance_of_getting_true``.

        :sample: chance_of_getting_true=25
        :sample: chance_of_getting_true=50
        :sample: chance_of_getting_true=75
           d   	generatorrandomrandint)selfr   s     _C:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\faker/providers/misc/__init__.pybooleanzProvider.boolean   s'     ~~$$,,Q48NNN    c                 \    dddd| j                   j                  j                  dd         S )zGGenerate ``None``, ``True``, or ``False``, each with equal probability.NTF)r   r   r&   r   r   )r!   s    r"   null_booleanzProvider.null_boolean(   s8     
 ..


'
'A
.	0 	0r$   lengthc                     | j                   j                  rFt        |      D cg c]'  }| j                   j                  j	                  d      ) }}t        |      S t        j                  |      S c c}w )zGenerate a random binary blob of ``length`` bytes.

        If this faker instance has been seeded, performance will be signficiantly reduced, to conform
        to the seeding.

        :sample: length=64
           )r   
_is_seededranger   	randrangebytesosurandom)r!   r(   _blobs       r"   binaryzProvider.binary1   s_     >>$$BG-P-QDNN))33C8-DP; zz&!!	 Qs   ,A2
raw_outputc                     t        j                  t        | j                  j                  j	                               j                               }|r|j                         S |j                         S )a2  Generate a random MD5 hash.

        If ``raw_output`` is ``False`` (default), a hexadecimal string representation of the MD5 hash
        will be returned. If ``True``, a ``bytes`` object representation will be returned instead.

        :sample: raw_output=False
        :sample: raw_output=True
        )hashlibmd5strr   r   encodedigest	hexdigestr!   r4   ress      r"   r7   zProvider.md5A   sN     %[[T^^-B-B-I-I-K)L)S)S)UV::<}}r$   c                     t        j                  t        | j                  j                  j	                               j                               }|r|j                         S |j                         S )a6  Generate a random SHA-1 hash.

        If ``raw_output`` is ``False`` (default), a hexadecimal string representation of the SHA-1 hash
        will be returned. If ``True``, a ``bytes`` object representation will be returned instead.

        :sample: raw_output=False
        :sample: raw_output=True
        )r6   sha1r8   r   r   r9   r:   r;   r<   s      r"   r?   zProvider.sha1O   sN     %\\#dnn.C.C.J.J.L*M*T*T*VW::<}}r$   c                     t        j                  t        | j                  j                  j	                               j                               }|r|j                         S |j                         S )a:  Generate a random SHA-256 hash.

        If ``raw_output`` is ``False`` (default), a hexadecimal string representation of the SHA-256 hash
        will be returned. If ``True``, a ``bytes`` object representation will be returned instead.

        :sample: raw_output=False
        :sample: raw_output=True
        )r6   sha256r8   r   r   r9   r:   r;   r<   s      r"   rA   zProvider.sha256]   sN     %^^C0E0E0L0L0N,O,V,V,XY::<}}r$   cast_toc                     t        j                  | j                  j                  j	                  d      d      }| ||      S |S )a"  Generate a random UUID4 object and cast it to another type if specified using a callable ``cast_to``.

        By default, ``cast_to`` is set to ``str``.

        May be called with ``cast_to=None`` to return a full-fledged ``UUID``.

        :sample:
        :sample: cast_to=None
              )intversion)uuidUUIDr   r   getrandbits)r!   rB   generated_uuids      r"   uuid4zProvider.uuid4k   sB     %)II$..2G2G2S2STW2Xbc$d>**r$   special_charsdigits
upper_case
lower_casec                 &   d}g }|r9|j                  | j                  j                  j                  d             |dz  }|rU|j                  | j                  j                  j                  t        j
                               |t        j
                  z  }|rU|j                  | j                  j                  j                  t        j                               |t        j                  z  }|rU|j                  | j                  j                  j                  t        j                               |t        j                  z  }t        |      |k  sJ d       | j                  ||      }t               }	t        |	      t        |      k  rY|	j                  | j                  j                  j                  dt        |      dz
               t        |	      t        |      k  rYt        |	      D ]  \  }
}||
   ||<    dj                  |      S )a  Generate a random password of the specified ``length``.

        The arguments ``special_chars``, ``digits``, ``upper_case``, and ``lower_case`` control
        what category of characters will appear in the generated password. If set to ``True``
        (default), at least one character from the corresponding category is guaranteed to appear.
        Special characters are characters from ``!@#$%^&*()_+``, digits are characters from
        ``0123456789``, and uppercase and lowercase characters are characters from the ASCII set of
        letters.

        :sample: length=12
        :sample: length=40, special_chars=False, upper_case=False
         z!@#$%^&*()_+z3Required length is shorter than required characters)r(   r   r   )appendr   r   choicestringrN   ascii_uppercaseascii_lowercaselenrandom_choicessetaddr    	enumeratejoin)r!   r(   rM   rN   rO   rP   choicesrequired_tokenscharsrandom_indexesiindexs               r"   passwordzProvider.password~   s   ( ""4>>#8#8#?#?#OP~%G""4>>#8#8#?#?#NOv}}$G""4>>#8#8#?#?@V@V#WXv---G""4>>#8#8#?#?@V@V#WXv---G?#v-d/dd- (((@ $'5.!C$88t~~44<<QE
QOP .!C$88 ".1HAu*1-E%L 2 wwu~r$   Nuncompressed_size	num_filesmin_file_sizecompressionc                    t        t        |t               xs |dk  t        |t               xs |dk  t        |t               xs |dk  g      rt        d      ||z  |kD  rt	        d      |dv rt
        j                  }n:|dv rt
        j                  }n%|dv rt
        j                  }nt
        j                  }t        j                         }|}t        j                  |d|      5 }t        d	|d	z         D ]  }	| j                  j                         t!        |	      z   }
|||	z
  |z  z
  }|	|k  r,| j                  j"                  j%                  ||      }||z
  }n|}| j                  j'                  |      }|j)                  |
|        	 d
d
d
       |j+                         S # 1 sw Y   |j+                         S xY w)a  Generate a bytes object containing a random valid zip archive file.

        The number and sizes of files contained inside the resulting archive can be controlled
        using the following arguments:

        - ``uncompressed_size`` - the total size of files before compression, 16 KiB by default
        - ``num_files`` - the number of files archived in resulting zip file, 1 by default
        - ``min_file_size`` - the minimum size of each file before compression, 4 KiB by default

        No compression is used by default, but setting ``compression`` to one of the values listed
        below will use the corresponding compression type.

        - ``'bzip2'`` or ``'bz2'`` for BZIP2
        - ``'lzma'`` or ``'xz'`` for LZMA
        - ``'deflate'``, ``'gzip'``, or ``'gz'`` for GZIP

        :sample: uncompressed_size=256, num_files=4, min_file_size=32
        :sample: uncompressed_size=256, num_files=32, min_file_size=4, compression='bz2'
        r   O`num_files`, `min_file_size`, and `uncompressed_size` must be positive integersH`uncompressed_size` is smaller than the calculated minimum required sizebzip2bz2lzmaxz)deflategzipgzw)moderh   r   N)any
isinstancerF   
ValueErrorAssertionErrorzipfile	ZIP_BZIP2ZIP_LZMAZIP_DEFLATED
ZIP_STOREDioBytesIOZipFiler,   r   pystrr8   r   r    r3   writestrgetvalue)r!   re   rf   rg   rh   compression_
zip_bufferremaining_size
zip_handlefile_numberfilenamemax_allowed_size	file_sizedatas                 r"   zipzProvider.zip   s   4 y#..@)q.}c22Hmq6H0#66P:Kq:P
 a  9$'88 Z  **",,LN*"++L55"//L"--LZZ\
*__Zc|LPZ$Q	A6>>//1C4DD#1Y5LP]4]#] * $ 5 5 = =mM] ^I%3i%?N .I~~,,Y7##Hd3  7 M ""$$ M ""$$s   ,B&F++Gc                    t        t        |t               xs |dk  t        |t               xs |dk  t        |t               xs |dk  g      rt        d      ||z  |kD  rt	        d      |dv rd}n|dv rd}n	|dv rd	}nd
}t        j                         }|}t        j                  ||      5 }t        d|dz         D ]  }	t        j                         }
| j                  j                         t        |	      z   }|||	z
  |z  z
  }|	|k  r,| j                  j                  j                  ||      }||z
  }n|}t        j                  |      }| j                  j!                  |      }|
j#                  |       t%        |
j'                               |_        |
j+                  d       |j-                  ||
       |
j/                           	 ddd       |j'                         S # 1 sw Y   |j'                         S xY w)a  Generate a bytes object containing a random valid tar file.

        The number and sizes of files contained inside the resulting archive can be controlled
        using the following arguments:

        - ``uncompressed_size`` - the total size of files before compression, 16 KiB by default
        - ``num_files`` - the number of files archived in resulting zip file, 1 by default
        - ``min_file_size`` - the minimum size of each file before compression, 4 KiB by default

        No compression is used by default, but setting ``compression`` to one of the values listed
        below will use the corresponding compression type.

        - ``'bzip2'`` or ``'bz2'`` for BZIP2
        - ``'lzma'`` or ``'xz'`` for LZMA
        - ``'gzip'`` or ``'gz'`` for GZIP

        :sample: uncompressed_size=256, num_files=4, min_file_size=32
        :sample: uncompressed_size=256, num_files=32, min_file_size=4, compression='bz2'
        r   rj   rk   )rs   rt   zw:gzrl   zw:bz2ro   zw:xzru   )rv   fileobjr   )nameN)rw   rx   rF   ry   rz   r   r   tarfileopenr,   r   r   r8   r   r    TarInfor3   writerX   r   sizeseekaddfileclose)r!   re   rf   rg   rh   rv   
tar_bufferr   
tar_handler   file_bufferr   r   r   tarinfor   s                   r"   tarzProvider.tar   s   4 y#..@)q.}c22Hmq6H0#66P:Kq:P
 a  9$'88 Z  .(D,,DN*DDZZ\
*\\tZ8J$Q	A6 jjl>>//1C4DD#1Y5LP]4]#] * $ 5 5 = =mM] ^I%3i%?N .I!//x8~~,,Y7!!$'";#7#7#9:  #""7K8!!##  7 9& ""$$' 9& ""$$s   3D"G..Hr   image_formathue
luminosityc           
         	 ddl }ddl}|\  }}|j                  j                  d|| j                  j                  ||            }|j                  j                  |      }	|	j                  t        | j                  dd            D 
cg c]&  }
| j                  d|      | j                  d|      f( c}
| j                  j                  ||      | j                  j                  ||      	       t        j                         5 }|j                  ||
       |j!                  d       |j#                         cddd       S # t        $ r t        dd      w xY wc c}
w # 1 sw Y   yxY w)a;  Generate an image and draw a random polygon on it using the Python Image Library.
        Without it installed, this provider won't be functional. Returns the bytes representing
        the image in a given format.

        The argument ``size`` must be a 2-tuple containing (width, height) in pixels. Defaults to 256x256.

        The argument ``image_format`` can be any valid format to the underlying library like ``'tiff'``,
        ``'jpeg'``, ``'pdf'`` or ``'png'`` (default). Note that some formats need present system libraries
        prior to building the Python Image Library.
        Refer to https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html for details.

        The arguments ``hue`` and ``luminosity`` are the same as in the color provider and are simply forwarded to
        it to generate both the background and the shape colors. Therefore, you can ask for a "dark blue" image, etc.

        :sample: size=(2, 2), hue='purple', luminosity='bright', image_format='pdf'
        :sample: size=(16, 16), hue=[90,270], image_format='ico'
        r   Nz-`image` requires the `Pillow` python library.imageRGB)r   r         )filloutline)format)	PIL.ImagePIL.ImageDrawImportErrorr   Imagenewr   color	ImageDrawDrawpolygonr,   
random_intr   r   saver   read)r!   r   r   r   r   PILwidthheightr   drawr1   fobjs               r"   r   zProvider.image;  sB   0	_  		eT4>>+?+?CT^+?+_`}}!!%(NSTXTcTcdegiTjNklNkdooa'F)CDNkl%%#*%ENN((SZ(H 	 	

 ZZ\TJJtLJ1IIaL99; \  	_$%TV]^^	_ m \s   E 
+E 	4E%E%E.dialectheaderdata_columnsnum_rowsinclude_row_ids	fmtparamsc                    t        |t              r|dk  rt        d      t        |t        t        f      st        d      |Ct        |t        t        f      st        d      t        |      t        |      k7  rt        d      t        j                         }t        j                  |fd|i|}|r0|rt        |      }|j                  dd       |j                  |       t        d|dz         D ]X  }	|D 
cg c]  }
| j                  j                  |
       }}
|r|j                  dt!        |	             |j                  |       Z |j#                         S c c}
w )	a  Generate random delimiter-separated values.

        This method's behavior share some similarities with ``csv.writer``. The ``dialect`` and
        ``**fmtparams`` arguments are the same arguments expected by ``csv.writer`` to control its
        behavior, and instead of expecting a file-like object to where output will be written, the
        output is controlled by additional keyword arguments and is returned as a string.

        The ``dialect`` argument defaults to ``'faker-csv'`` which is the name of a ``csv.excel``
        subclass with full quoting enabled.

        The ``header`` argument expects a list or a tuple of strings that will serve as the header row
        if supplied. The ``data_columns`` argument expects a list or a tuple of string tokens, and these
        string tokens will be passed to  :meth:`pystr_format() <faker.providers.python.Provider.pystr_format>`
        for data generation. Argument Groups are used to pass arguments to the provider methods.
        Both ``header`` and ``data_columns`` must be of the same length.

        Example:
            fake.set_arguments('top_half', {'min_value': 50, 'max_value': 100})
            fake.dsv(data_columns=('{{ name }}', '{{ pyint:top_half }}'))

        The ``num_rows`` argument controls how many rows of data to generate, and the ``include_row_ids``
        argument may be set to ``True`` to include a sequential row ID column.

        :sample: dialect='excel', data_columns=('{{name}}', '{{address}}')
        :sample: dialect='excel-tab', data_columns=('{{name}}', '{{address}}'), include_row_ids=True
        :sample: data_columns=('{{name}}', '{{address}}'), num_rows=5, delimiter='$'
        r   z%`num_rows` must be a positive integerz(`data_columns` must be a tuple or a listz"`header` must be a tuple or a listz6`header` and `data_columns` must have matching lengthsr   IDr   )rx   rF   ry   listtuple	TypeErrorrX   r   StringIOcsvwriterinsertwriterowr,   r   pystr_formatr8   r   )r!   r   r   r   r   r   r   
dsv_bufferr   row_numcolumnrows               r"   dsvzProvider.dsvf  s4   J (C(HMDEE,u6FGGftUm4 DEE6{c,// !YZZ[[]
JEE9Efa&OOF#Q1-GEQR\64>>..v6\CR

1c'l+OOC  . ""$$ Ss   ;"Ec                 .    | j                  ||||d      S )a  Generate random comma-separated values.

        For more information on the different arguments of this method, please refer to
        :meth:`dsv() <faker.providers.misc.Provider.dsv>` which is used under the hood.

        :sample: data_columns=('{{name}}', '{{address}}'), num_rows=10, include_row_ids=False
        :sample: header=('Name', 'Address', 'Favorite Color'),
                data_columns=('{{name}}', '{{address}}', '{{safe_color_name}}'),
                num_rows=10, include_row_ids=True
        ,r   r   r   r   	delimiterr   r!   r   r   r   r   s        r"   r   zProvider.csv  )    " xx%+  
 	
r$   c                 .    | j                  ||||d      S )a   Generate random tab-separated values.

        For more information on the different arguments of this method, please refer to
        :meth:`dsv() <faker.providers.misc.Provider.dsv>` which is used under the hood.

        :sample: data_columns=('{{name}}', '{{address}}'), num_rows=10, include_row_ids=False
        :sample: header=('Name', 'Address', 'Favorite Color'),
                data_columns=('{{name}}', '{{address}}', '{{safe_color_name}}'),
                num_rows=10, include_row_ids=True
        	r   r   r   s        r"   tsvzProvider.tsv  s)    " xx%+  
 	
r$   c                 .    | j                  ||||d      S )a  Generate random pipe-separated values.

        For more information on the different arguments of this method, please refer to
        :meth:`dsv() <faker.providers.misc.Provider.dsv>` which is used under the hood.

        :sample: data_columns=('{{name}}', '{{address}}'), num_rows=10, include_row_ids=False
        :sample: header=('Name', 'Address', 'Favorite Color'),
                data_columns=('{{name}}', '{{address}}', '{{safe_color_name}}'),
                num_rows=10, include_row_ids=True
        |r   r   r   s        r"   psvzProvider.psv  r   r$   indentclsc                 H    | j                  ||||      j                         S )z
        Generate random JSON structure and return as bytes.

        For more information on the different arguments of this method, refer to
        :meth:`json() <faker.providers.misc.Provider.json>` which is used under the hood.
        )r   r   r   r   )jsonr9   )r!   r   r   r   r   s        r"   
json_byteszProvider.json_bytes  s%     yylXfZ]y^eeggr$   c                    	
 ddd}|r|n|}dt         t           dt        f
 fd
dt        t        t        t
        t        t        t        f   f   dt        f	 fd	dt        t        t        f   dt        f	
fd	}|d
k(  rt        j                   ||      ||      S t        |      D cg c]
  } ||       }}t        j                  |||      S c c}w )a  
        Generate random JSON structure values.

        Using a dictionary or list of records that is passed as ``data_columns``,
        define the structure that is used to build JSON structures.  For complex
        data structures it is recommended to use the dictionary format.

        Data Column Dictionary format:
            {'key name': 'definition'}

        The definition can be 'provider', 'provider:argument_group', tokenized
        'string {{ provider:argument_group }}' that is passed to the python
        provider method pystr_format() for generation, or a fixed '@word'.
        Using Lists, Tuples, and Dicts as a definition for structure.

        Example:
            fake.set_arguments('top_half', {'min_value': 50, 'max_value': 100})
            fake.json(data_columns={'Name': 'name', 'Score': 'pyint:top_half'})

        Data Column List format:
            [('key name', 'definition', {'arguments'})]

        With the list format the definition can be a list of records, to create
        a list within the structure data.  For literal entries within the list,
        set the 'field_name' to None.

        :param data_columns: specification for the data structure
        :type data_columns: dict
        :param num_rows: number of rows the returned
        :type num_rows: int
        :param indent: number of spaces to indent the fields
        :type indent: int
        :param cls: optional json encoder to use for non-standard objects such as datetimes
        :type cls: json.JSONEncoder
        :return: Serialized JSON data
        :rtype: str

        :sample: data_columns={'Spec': '@1.0.1', 'ID': 'pyint',
                'Details': {'Name': 'name', 'Address': 'address'}}, num_rows=2
        :sample: data_columns={'Candidates': ['name', 'name', 'name']},
                num_rows=1
        :sample: data_columns=[('Name', 'name'), ('Points', 'pyint',
                {'min_value': 50, 'max_value': 100})], num_rows=1
        {{name}}{{address}})r   	residencyr   r   c                 f   i }| D ]  ^}}}|r|d   ni }t        |t              st        d      | j                  |fi |c S t        |t              r |      ||<   ]t        |t
        t        f      r|D cg c]  } |g       c}||<    j                  |fi |||<    |S c c}w )Nr   ,Invalid arguments type. Must be a dictionary)rx   dictr   _value_format_selectionr   r   rZ   )	r   entryr   
definition	argumentskwargsitemprocess_list_structurer!   s	          r"   r   z-Provider.json.<locals>.process_list_structure:  s    $&E04,j9)21!&$/#$RSS<7477
MfMMj%0"8"DE$K
T3K8NX"Yjd#94&#Aj"YE$K">$">">z"TV"TE$K 15 L #Zs   =B.c                    i }t        | t              rj                  |       S t        | t              r| j	                         D ]z  \  }}t        |t
        t        t        f      r|D cg c]
  } |       c}||<   ;t        |t        t        t        t        f      r |      ||<   gj                  |      ||<   | |S | S c c}w )N)rx   r8   r   r   itemsr   r   rZ   rF   floatbool)r   r   r   r   r   process_dict_structurer!   s        r"   r   z-Provider.json.<locals>.process_dict_structureN  s    $&E$$33D99$%(,

$D*!*udC.@APZ&[PZ'=d'CPZ&[d#JsE40HI&<Z&Hd&*&B&B:&Nd )5 K '\s   *Cr   c                 z    t        | t              r |       S t        | t              r |       S t        d      )Nz7Invalid data_columns type. Must be a dictionary or list)rx   r   r   r   )r   r   r   s    r"   create_json_structurez,Provider.json.<locals>.create_json_structure`  s9    ,--l;;,--l;;UVVr$   r   )r   r   )r   r   r   rF   r   r   r   r8   r   r   r   dumpsr,   )r!   r   r   r   r   default_data_columnsr   r1   r   r   r   s   `        @@r"   r   zProvider.json  s    h & 
 ;G,L`	# 	3 	(	sE4c3h/O)P 	UX 	$	WdDj0A 	Wd 	W q=::3LA&VYZZ=B8_M_%l3_Mzz$v377 Ns   0Cnb_elementsvariable_nb_elementsvalue_typesallowed_typesc                     	 ddl }| j                  j	                  ||||      }| j                  j                         |i}|j                  |      S # t        $ r t        dd      w xY w)a  
        Returns some XML.

        :nb_elements: number of elements for dictionary
        :variable_nb_elements: is use variable number of elements for dictionary
        :value_types: type of dictionary values

        Note: this provider required xmltodict library installed
        r   Nz.`xml` requires the `xmltodict` Python library.xml)r   r   r   r   )	xmltodictr   r   r   pydictwordunparse)r!   r   r   r   r   r  _dicts          r"   r   zProvider.xmlo  s~     	^ %%#!5#'	 & 
 $$&.  ''  	^$%UW\]]	^s   A A(alignc           	         dddddifg}||}ddd	d
}g }t        |      D ]  }g }|D ]f  ^}	}
}|r|d   ni }t        |t              st        d       | j                  |
fi |}|j                  ||j                  |d       |	 d|	        h |j                  dj                  |              dj                  |      S )a  
        Generate random fixed width values.

        Using a list of tuple records that is passed as ``data_columns``, that
        defines the structure that will be generated. Arguments within the
        record are provider specific, and should be a dictionary that will be
        passed to the provider method.

        Data Column List format
            [('field width', 'definition', {'arguments'})]

        The definition can be 'provider', 'provider:argument_group', tokenized
        'string {{ provider:argument_group }}' that is passed to the python
        provider method pystr_format() for generation, or a fixed '@word'.
        Using Lists, Tuples, and Dicts as a definition for structure.

        Argument Groups can be used to pass arguments to the provider methods,
        but will override the arguments supplied in the tuple record.

        Example:
            fake.set_arguments('top_half', {'min_value': 50, 'max_value': 100})
            fake.fixed_width(data_columns=[(20, 'name'), (3, 'pyint:top_half')])

        :param data_columns: specification for the data structure
        :type data_columns: list
        :param num_rows: number of rows the generator will yield
        :type num_rows: int
        :param align: positioning of the value. (left, middle, right)
        :type align: str
        :return: Serialized Fixed Width data
        :rtype: str

        :sample: data_columns=[(20, 'name'), (3, 'pyint', {'min_value': 50,
                'max_value': 100})], align='right', num_rows=2
        )   r   r   pyint	max_valuer  N<^>)leftmiddlerightr   r   rR   
)r,   rx   r   r   r   rS   getr]   )r!   r   r   r  r   	align_mapr   r1   r   r   r   r   r   results                 r"   fixed_widthzProvider.fixed_width  s    J +r*+ 
 (<L
	
 xAC1=-zI)21!&$/#$RSS555jKFK

fimmE3&?%@$GH&5QR 2> KK% ! yyr$   r   r   c                    t        j                  d|      r| j                  j                  |      S t        j                  d|      r|j	                  d      S t        j                  d|      rh|j                  d      \  }}| j                  j                  |j                               } | j                  j                  |j                         fi |S  | j                  j                  |fi |S )a  
        Formats the string in different ways depending on its contents.

        The return can be the '@word' itself, a '{{ token }}' passed to PyStr,
        or a 'provider:argument_group' format field that returns potentially
        a non-string type.

        This ensures that Numbers, Boolean types that are generated in the
        JSON structures in there proper type, and not just strings.
        z.*\{\{.*\}\}.*z^@.*@z^[a-zA-Z0-9_-]*:\w:)	rematchr   r   lstripsplitget_argumentsstripr   )r!   r   r   argument_groupr   s        r"   r   z Provider._value_format_selection  s     88%z2>>..z:: 88GZ($$S)) 88):6)3)9)9#)>&J44^5I5I5KLI(4>>(()9)9);IyII %t~~$$Z:6::r$   )2   )i   )F)
   TTTT)i   r   i   N))r*   r*   pngNN)r   Nr   r   r!  F)Nr#  r!  F)Nr!  NN)r!  TNN)Nr!  r  )(__name__
__module____qualname__rF   r   r#   r   r'   r.   r3   r   r8   r7   r?   rA   r   rH   rI   rL   rd   r   r   r
   r   r   r   r   r   r   r   r   r   r   JSONEncoderr   r   r   r   r  r    r$   r"   r   r      s   Oc O4 O0htn 0"S " " d uUCZ/@ t eSj0A  %s
2C   ^a%$))c)9 :Hdii[RWEW<X XYZ 
uc499$	%* "11 1 	1
 1 1 
1j "'!%)@%@% @% 	@%
 c]@% 
@%H "'!%)F%F% F% 	F%
 c]F% 
F%T !+!8<$()CHo) ) eC#345	)
 SM) 
)Z #*.(C %?%?% #'?% CHo	?%
 ?% ?% ?% 
?%F +/(C %
#'
 CHo
 	

 
 

6 +/(C %
#'
 CHo
 	

 
 

6 +/(C %
#'
 CHo
 	

 
 

6 (, $04htnh h 	h
 d4++,-h 
h" (, $04l8tnl8 l8 	l8
 d4++,-l8 
l8` %)+/-1(( #( i(	(
  	*( 
(:>(= >PS >ad >ru >@;# ; ;sTWx ;r$   r   )'r   r6   r   r   r/   r  rU   r   rH   r{   typingr   r   r   r   r   r   r	   r
   r   r   typing_extensionsr   faker.exceptionsr   rR   r   pythonr   	localizedregister_dialectexcel	QUOTE_ALLrF   r8   r   __annotations__r   r   r(  r$   r"   <module>r2     s    
  	  	 	     Y Y Y ' /  	   [#))S]] C eCHouS#tCH~5M/NNO
I Oj)Y )J;| J;r$   