Current Dir: /snap/core22/2955/usr/lib/python3.10/__pycache__/

[FILE] abc.cpython-310.pyc [ edit | delete | rename ]
[FILE] aifc.cpython-310.pyc [ edit | delete | rename ]
[FILE] antigravity.cpython-310.pyc [ edit | delete | rename ]
[FILE] argparse.cpython-310.pyc [ edit | delete | rename ]
[FILE] ast.cpython-310.pyc [ edit | delete | rename ]
[FILE] asynchat.cpython-310.pyc [ edit | delete | rename ]
[FILE] asyncore.cpython-310.pyc [ edit | delete | rename ]
[FILE] base64.cpython-310.pyc [ edit | delete | rename ]
[FILE] bdb.cpython-310.pyc [ edit | delete | rename ]
[FILE] binhex.cpython-310.pyc [ edit | delete | rename ]
[FILE] bisect.cpython-310.pyc [ edit | delete | rename ]
[FILE] bz2.cpython-310.pyc [ edit | delete | rename ]
[FILE] calendar.cpython-310.pyc [ edit | delete | rename ]
[FILE] cgi.cpython-310.pyc [ edit | delete | rename ]
[FILE] cgitb.cpython-310.pyc [ edit | delete | rename ]
[FILE] chunk.cpython-310.pyc [ edit | delete | rename ]
[FILE] cmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] code.cpython-310.pyc [ edit | delete | rename ]
[FILE] codecs.cpython-310.pyc [ edit | delete | rename ]
[FILE] codeop.cpython-310.pyc [ edit | delete | rename ]
[FILE] colorsys.cpython-310.pyc [ edit | delete | rename ]
[FILE] compileall.cpython-310.pyc [ edit | delete | rename ]
[FILE] configparser.cpython-310.pyc [ edit | delete | rename ]
[FILE] contextlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] contextvars.cpython-310.pyc [ edit | delete | rename ]
[FILE] copy.cpython-310.pyc [ edit | delete | rename ]
[FILE] copyreg.cpython-310.pyc [ edit | delete | rename ]
[FILE] cProfile.cpython-310.pyc [ edit | delete | rename ]
[FILE] crypt.cpython-310.pyc [ edit | delete | rename ]
[FILE] csv.cpython-310.pyc [ edit | delete | rename ]
[FILE] dataclasses.cpython-310.pyc [ edit | delete | rename ]
[FILE] datetime.cpython-310.pyc [ edit | delete | rename ]
[FILE] decimal.cpython-310.pyc [ edit | delete | rename ]
[FILE] difflib.cpython-310.pyc [ edit | delete | rename ]
[FILE] dis.cpython-310.pyc [ edit | delete | rename ]
[FILE] doctest.cpython-310.pyc [ edit | delete | rename ]
[FILE] enum.cpython-310.pyc [ edit | delete | rename ]
[FILE] filecmp.cpython-310.pyc [ edit | delete | rename ]
[FILE] fileinput.cpython-310.pyc [ edit | delete | rename ]
[FILE] fnmatch.cpython-310.pyc [ edit | delete | rename ]
[FILE] fractions.cpython-310.pyc [ edit | delete | rename ]
[FILE] ftplib.cpython-310.pyc [ edit | delete | rename ]
[FILE] functools.cpython-310.pyc [ edit | delete | rename ]
[FILE] genericpath.cpython-310.pyc [ edit | delete | rename ]
[FILE] getopt.cpython-310.pyc [ edit | delete | rename ]
[FILE] getpass.cpython-310.pyc [ edit | delete | rename ]
[FILE] gettext.cpython-310.pyc [ edit | delete | rename ]
[FILE] glob.cpython-310.pyc [ edit | delete | rename ]
[FILE] graphlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] gzip.cpython-310.pyc [ edit | delete | rename ]
[FILE] hashlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] heapq.cpython-310.pyc [ edit | delete | rename ]
[FILE] hmac.cpython-310.pyc [ edit | delete | rename ]
[FILE] imaplib.cpython-310.pyc [ edit | delete | rename ]
[FILE] imghdr.cpython-310.pyc [ edit | delete | rename ]
[FILE] imp.cpython-310.pyc [ edit | delete | rename ]
[FILE] inspect.cpython-310.pyc [ edit | delete | rename ]
[FILE] io.cpython-310.pyc [ edit | delete | rename ]
[FILE] ipaddress.cpython-310.pyc [ edit | delete | rename ]
[FILE] keyword.cpython-310.pyc [ edit | delete | rename ]
[FILE] linecache.cpython-310.pyc [ edit | delete | rename ]
[FILE] locale.cpython-310.pyc [ edit | delete | rename ]
[FILE] lzma.cpython-310.pyc [ edit | delete | rename ]
[FILE] mailbox.cpython-310.pyc [ edit | delete | rename ]
[FILE] mailcap.cpython-310.pyc [ edit | delete | rename ]
[FILE] mimetypes.cpython-310.pyc [ edit | delete | rename ]
[FILE] modulefinder.cpython-310.pyc [ edit | delete | rename ]
[FILE] netrc.cpython-310.pyc [ edit | delete | rename ]
[FILE] nntplib.cpython-310.pyc [ edit | delete | rename ]
[FILE] ntpath.cpython-310.pyc [ edit | delete | rename ]
[FILE] nturl2path.cpython-310.pyc [ edit | delete | rename ]
[FILE] numbers.cpython-310.pyc [ edit | delete | rename ]
[FILE] opcode.cpython-310.pyc [ edit | delete | rename ]
[FILE] operator.cpython-310.pyc [ edit | delete | rename ]
[FILE] optparse.cpython-310.pyc [ edit | delete | rename ]
[FILE] os.cpython-310.pyc [ edit | delete | rename ]
[FILE] pathlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] pdb.cpython-310.pyc [ edit | delete | rename ]
[FILE] pickle.cpython-310.pyc [ edit | delete | rename ]
[FILE] pickletools.cpython-310.pyc [ edit | delete | rename ]
[FILE] pipes.cpython-310.pyc [ edit | delete | rename ]
[FILE] pkgutil.cpython-310.pyc [ edit | delete | rename ]
[FILE] platform.cpython-310.pyc [ edit | delete | rename ]
[FILE] plistlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] poplib.cpython-310.pyc [ edit | delete | rename ]
[FILE] posixpath.cpython-310.pyc [ edit | delete | rename ]
[FILE] pprint.cpython-310.pyc [ edit | delete | rename ]
[FILE] profile.cpython-310.pyc [ edit | delete | rename ]
[FILE] pstats.cpython-310.pyc [ edit | delete | rename ]
[FILE] pty.cpython-310.pyc [ edit | delete | rename ]
[FILE] pyclbr.cpython-310.pyc [ edit | delete | rename ]
[FILE] pydoc.cpython-310.pyc [ edit | delete | rename ]
[FILE] py_compile.cpython-310.pyc [ edit | delete | rename ]
[FILE] queue.cpython-310.pyc [ edit | delete | rename ]
[FILE] quopri.cpython-310.pyc [ edit | delete | rename ]
[FILE] random.cpython-310.pyc [ edit | delete | rename ]
[FILE] re.cpython-310.pyc [ edit | delete | rename ]
[FILE] reprlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] rlcompleter.cpython-310.pyc [ edit | delete | rename ]
[FILE] runpy.cpython-310.pyc [ edit | delete | rename ]
[FILE] sched.cpython-310.pyc [ edit | delete | rename ]
[FILE] secrets.cpython-310.pyc [ edit | delete | rename ]
[FILE] selectors.cpython-310.pyc [ edit | delete | rename ]
[FILE] shelve.cpython-310.pyc [ edit | delete | rename ]
[FILE] shlex.cpython-310.pyc [ edit | delete | rename ]
[FILE] shutil.cpython-310.pyc [ edit | delete | rename ]
[FILE] signal.cpython-310.pyc [ edit | delete | rename ]
[FILE] site.cpython-310.pyc [ edit | delete | rename ]
[FILE] sitecustomize.cpython-310.pyc [ edit | delete | rename ]
[FILE] smtpd.cpython-310.pyc [ edit | delete | rename ]
[FILE] smtplib.cpython-310.pyc [ edit | delete | rename ]
[FILE] sndhdr.cpython-310.pyc [ edit | delete | rename ]
[FILE] socket.cpython-310.pyc [ edit | delete | rename ]
[FILE] socketserver.cpython-310.pyc [ edit | delete | rename ]
[FILE] sre_compile.cpython-310.pyc [ edit | delete | rename ]
[FILE] sre_constants.cpython-310.pyc [ edit | delete | rename ]
[FILE] sre_parse.cpython-310.pyc [ edit | delete | rename ]
[FILE] ssl.cpython-310.pyc [ edit | delete | rename ]
[FILE] stat.cpython-310.pyc [ edit | delete | rename ]
[FILE] statistics.cpython-310.pyc [ edit | delete | rename ]
[FILE] string.cpython-310.pyc [ edit | delete | rename ]
[FILE] stringprep.cpython-310.pyc [ edit | delete | rename ]
[FILE] struct.cpython-310.pyc [ edit | delete | rename ]
[FILE] subprocess.cpython-310.pyc [ edit | delete | rename ]
[FILE] sunau.cpython-310.pyc [ edit | delete | rename ]
[FILE] symtable.cpython-310.pyc [ edit | delete | rename ]
[FILE] sysconfig.cpython-310.pyc [ edit | delete | rename ]
[FILE] tabnanny.cpython-310.pyc [ edit | delete | rename ]
[FILE] tarfile.cpython-310.pyc [ edit | delete | rename ]
[FILE] telnetlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] tempfile.cpython-310.pyc [ edit | delete | rename ]
[FILE] textwrap.cpython-310.pyc [ edit | delete | rename ]
[FILE] this.cpython-310.pyc [ edit | delete | rename ]
[FILE] threading.cpython-310.pyc [ edit | delete | rename ]
[FILE] timeit.cpython-310.pyc [ edit | delete | rename ]
[FILE] token.cpython-310.pyc [ edit | delete | rename ]
[FILE] tokenize.cpython-310.pyc [ edit | delete | rename ]
[FILE] trace.cpython-310.pyc [ edit | delete | rename ]
[FILE] traceback.cpython-310.pyc [ edit | delete | rename ]
[FILE] tracemalloc.cpython-310.pyc [ edit | delete | rename ]
[FILE] tty.cpython-310.pyc [ edit | delete | rename ]
[FILE] turtle.cpython-310.pyc [ edit | delete | rename ]
[FILE] types.cpython-310.pyc [ edit | delete | rename ]
[FILE] typing.cpython-310.pyc [ edit | delete | rename ]
[FILE] uu.cpython-310.pyc [ edit | delete | rename ]
[FILE] uuid.cpython-310.pyc [ edit | delete | rename ]
[FILE] warnings.cpython-310.pyc [ edit | delete | rename ]
[FILE] wave.cpython-310.pyc [ edit | delete | rename ]
[FILE] weakref.cpython-310.pyc [ edit | delete | rename ]
[FILE] webbrowser.cpython-310.pyc [ edit | delete | rename ]
[FILE] xdrlib.cpython-310.pyc [ edit | delete | rename ]
[FILE] zipapp.cpython-310.pyc [ edit | delete | rename ]
[FILE] zipfile.cpython-310.pyc [ edit | delete | rename ]
[FILE] zipimport.cpython-310.pyc [ edit | delete | rename ]
[FILE] _aix_support.cpython-310.pyc [ edit | delete | rename ]
[FILE] _bootsubprocess.cpython-310.pyc [ edit | delete | rename ]
[FILE] _collections_abc.cpython-310.pyc [ edit | delete | rename ]
[FILE] _compat_pickle.cpython-310.pyc [ edit | delete | rename ]
[FILE] _compression.cpython-310.pyc [ edit | delete | rename ]
[FILE] _distutils_system_mod.cpython-310.pyc [ edit | delete | rename ]
[FILE] _markupbase.cpython-310.pyc [ edit | delete | rename ]
[FILE] _osx_support.cpython-310.pyc [ edit | delete | rename ]
[FILE] _pydecimal.cpython-310.pyc [ edit | delete | rename ]
[FILE] _pyio.cpython-310.pyc [ edit | delete | rename ]
[FILE] _py_abc.cpython-310.pyc [ edit | delete | rename ]
[FILE] _sitebuiltins.cpython-310.pyc [ edit | delete | rename ]
[FILE] _strptime.cpython-310.pyc [ edit | delete | rename ]
[FILE] _sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc [ edit | delete | rename ]
[FILE] _sysconfigdata__x86_64-linux-gnu.cpython-310.pyc [ edit | delete | rename ]
[FILE] _threading_local.cpython-310.pyc [ edit | delete | rename ]
[FILE] _weakrefset.cpython-310.pyc [ edit | delete | rename ]
[FILE] __future__.cpython-310.pyc [ edit | delete | rename ]
[FILE] __phello__.foo.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3.10/__pycache__/csv.cpython-310.pyc

o

�9j�>�@sdZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZgd�ZGdd�d�ZGd	d
�d
e�Zed
e�Gdd�de�Zed
e�Gdd�de�Zede�Gdd�d�ZGdd�d�ZzeWney�eZYnwGdd�d�ZdS)z+
csv.py - read/write/investigate CSV files
�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIO)rrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dd�ZdS)	rz�Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    �FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib/python3.10/csv.py�__init__*s
zDialect.__init__c
Cs4zt|�WdSty}ztt|���d}~ww�N)�_Dialect�	TypeErrorr�str)r�errrr/s��zDialect._validate)�__name__�
__module__�__qualname__r�_namer�	delimiter�	quotechar�
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsrc@�(eZdZdZdZdZdZdZdZe	Z
dS)rz;Describe the usual properties of Excel-generated CSV files.�,�"TF�
N)r&r'r(rr*r+r-r.r/rr0rrrrr6�rc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files.�	N)r&r'r(rr*rrrrr@srz	excel-tabc@r1)rz:Describe the usual properties of Unix-generated CSV files.r2r3TF�
N)r&r'r(rr*r+r-r.r/rr0rrrrrEr5r�unixc@sDeZdZ		ddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs<||_||_||_t||g|�Ri|��|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr;r<r=�args�kwdsrrrr Qs
zDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs>|jdurzt|j�|_Wn	tyYnw|jj|_|jSr!)r:�nextr�
StopIterationr>rrrrr@]s
�
zDictReader.fieldnamescCs
||_dSr!)r:)r�valuerrrr@gs
cCs�|jdkr|jt|j�}|jj|_|gkrt|j�}|gkstt|j|��}t|j�}t|�}||kr?||d�||j<|S||krR|j|d�D]}|j||<qJ|Sr9)	r>r@rDr�dict�zip�lenr;r<)r�row�d�lf�lr�keyrrr�__next__ks"



�
�zDictReader.__next__)NNNr)	r&r'r(r rC�propertyr@�setterrOrrrrrPs
�	
	
rc@s:eZdZ		ddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsH||_||_|��dvrtd|��||_t||g|�Ri|��|_dS)N)rR�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r@r<�lower�
ValueError�extrasactionr)rr?r@r<rVr=rArBrrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rGrHr@�writerow)r�headerrrr�writeheader�s
zDictWriter.writeheadercsN�jdkr����j}|rtdd�dd�|D������fdd��jD�S)NrRz(dict contains fields not in fieldnames: z, cS�g|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>��z,DictWriter._dict_to_list.<locals>.<listcomp>c3s�|]
}��|�j�VqdSr!)�getr<)r\rN��rowdictrrr�	<genexpr>�s�z+DictWriter._dict_to_list.<locals>.<genexpr>)rV�keysr@rU�join)rrb�wrong_fieldsrrar�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrWrg)rrbrrrrW�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�maprg)r�rowdictsrrrrh�szDictWriter.writerowsN)rrRr)r&r'r(r rYrgrWrhrrrrr�s
�
rc@s:eZdZdZdd�Zd
dd�Zdd�Zd	d
�Zdd�ZdS)rze
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    cCsgd�|_dS)N)r2r6�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s|�||�\}}|std��Gdd�dt�}||_||_|p+d|_||_|S)zI
        Returns a dialect (or None) corresponding to the sample
        zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialect�sniffedr4N)r&r'r(r)r/rr0rrrrr=�sr=r3)�_guess_quote_and_delimiter�_guess_delimiterrrr-r*r+r.)r�sample�
delimitersr+r-r*r.r=rrr�sniff�s

��
z
Sniffer.sniffc	Cs�g}dD]}t�|tjtjB�}|�|�}|rnq|sdSi}i}d}|j}	|D]\}
|	dd}|
|}|rA|�|d�d||<z|	dd}|
|}Wn	tyVYq)w|rk|dusa||vrk|�|d�d||<z|	dd}Wn	ty|Yq)w|
|r�|d7}q)t||jd	�}
|r�t||jd	�}|||k}|d
kr�d}nd}d}t�dt�	|�|
d
�tj�}|�
|�r�d}nd}|
|||fS)a�
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        )zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimN�space�rNr7rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rwruTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexr`�KeyError�max�escape�search)r�datars�matches�restr�regexp�quotes�delims�spacesr�m�nrNr+rwr.�	dq_regexpr-rrrrp�sj
�������
z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�r-|d7}||	|
�D] }|D]}|�|i�}
|�|�}|
�|d�d|
|<|
||<q<q8|��D]N}t||�	��}t|�dkrv|dddkrvq]t|�dkr�t
|d	d
�d�||<|�||�||d||dtdd
�|D��f||<q]|d||<q]|�	�}t
t||t|���}d}d}t|�dkr�||kr�|D]$\}}|ddkr�|ddkr�|d||kr�|dus�||vr�|||<q�|d8}t|�dkr�||ks�t|�dk�r!t|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
|	t|�ks.|�s2dSt|�dk�r]|jD] }||��v�r[|d�|�|d�d|�k}||fS�q<dd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)a�
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        Nr7cSrZr)�chr)r\�crrrr^-r_z,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrvcSs|dS)Nrvr)r]rrr�<lambda>Gsz*Sniffer._guess_delimiter.<locals>.<lambda>rycss�|]}|dVqdS)rvNr)r\�itemrrrrcLs�z+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)r\�k�vrrrr^vs���)�list�filter�split�range�minrIr`�countrd�itemsr��remove�sum�floatrn�sort)rr�rs�ascii�chunkLength�	iteration�
charFrequency�modesr��start�end�line�char�
metaFrequency�freqr��modeList�total�consistency�	thresholdr�r�rwr.rKrrrrqs�


������3
���zSniffer._guess_delimiterc
Csjtt|�|�|��}t|�}t|�}i}t|�D]}d||<qd}|D]L}|dkr+nE|d7}t|�|kr6q#t|���D]2}	t}
z|
||	�Wnt	t
fyYt||	�}
Ynw|
||	krn||	durk|
||	<q<||	=q<q#d}|��D]:\}	}t|�td�kr�t||	�|kr�|d7}qv|d8}qvz|||	�Wnt	t
fy�|d7}Yqvw|d8}qv|dkS)Nr�rv)rrrtrDrIr�r�rd�complexrU�
OverflowErrorr��typer#)
rrr�rdrrX�columns�columnTypes�i�checkedrJ�col�thisType�	hasHeader�colTyperrr�
has_headersL
�
��

�
zSniffer.has_headerr!)	r&r'r(rr rtrprqr�rrrrr�s
Lgr)rrz�_csvrrrrrrrr	r
rrr
rrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>s*@


2�
Upload File: