/snap/core18/2999/usr/lib/python3.6/__pycache__
NameSizeModeActions
abc.cpython-36.pyc75150644editdlrm
aifc.cpython-36.pyc259430644editdlrm
antigravity.cpython-36.pyc7790644editdlrm
argparse.cpython-36.pyc604560644editdlrm
ast.cpython-36.pyc117040644editdlrm
asynchat.cpython-36.pyc68150644editdlrm
asyncore.cpython-36.pyc158380644editdlrm
base64.cpython-36.pyc170590644editdlrm
bdb.cpython-36.pyc170330644editdlrm
binhex.cpython-36.pyc120860644editdlrm
bisect.cpython-36.pyc26760644editdlrm
bz2.cpython-36.pyc112820644editdlrm
calendar.cpython-36.pyc258820644editdlrm
cgi.cpython-36.pyc284160644editdlrm
cgitb.cpython-36.pyc100800644editdlrm
chunk.cpython-36.pyc49000644editdlrm
cmd.cpython-36.pyc125750644editdlrm
code.cpython-36.pyc98360644editdlrm
codecs.cpython-36.pyc339000644editdlrm
codeop.cpython-36.pyc62700644editdlrm
colorsys.cpython-36.pyc33110644editdlrm
compileall.cpython-36.pyc82780644editdlrm
configparser.cpython-36.pyc452440644editdlrm
contextlib.cpython-36.pyc111580644editdlrm
copy.cpython-36.pyc70790644editdlrm
copyreg.cpython-36.pyc42440644editdlrm
cProfile.cpython-36.pyc42940644editdlrm
crypt.cpython-36.pyc22420644editdlrm
csv.cpython-36.pyc118550644editdlrm
datetime.cpython-36.pyc545110644editdlrm
decimal.cpython-36.pyc3510644editdlrm
difflib.cpython-36.pyc596420644editdlrm
dis.cpython-36.pyc141810644editdlrm
doctest.cpython-36.pyc755890644editdlrm
dummy_threading.cpython-36.pyc11020644editdlrm
enum.cpython-36.pyc234530644editdlrm
filecmp.cpython-36.pyc83050644editdlrm
fileinput.cpython-36.pyc131520644editdlrm
fnmatch.cpython-36.pyc28740644editdlrm
formatter.cpython-36.pyc175790644editdlrm
fractions.cpython-36.pyc184260644editdlrm
ftplib.cpython-36.pyc283570644editdlrm
functools.cpython-36.pyc240620644editdlrm
genericpath.cpython-36.pyc37260644editdlrm
getopt.cpython-36.pyc62170644editdlrm
getpass.cpython-36.pyc41770644editdlrm
gettext.cpython-36.pyc143060644editdlrm
glob.cpython-36.pyc42590644editdlrm
gzip.cpython-36.pyc162260644editdlrm
hashlib.cpython-36.pyc66920644editdlrm
heapq.cpython-36.pyc142920644editdlrm
hmac.cpython-36.pyc48360644editdlrm
imaplib.cpython-36.pyc421380644editdlrm
imghdr.cpython-36.pyc41500644editdlrm
imp.cpython-36.pyc96960644editdlrm
inspect.cpython-36.pyc797390644editdlrm
io.cpython-36.pyc33870644editdlrm
ipaddress.cpython-36.pyc623860644editdlrm
keyword.cpython-36.pyc17650644editdlrm
linecache.cpython-36.pyc37780644editdlrm
locale.cpython-36.pyc340300644editdlrm
lzma.cpython-36.pyc119920644editdlrm
macpath.cpython-36.pyc56410644editdlrm
macurl2path.cpython-36.pyc18670644editdlrm
mailbox.cpython-36.pyc637520644editdlrm
mailcap.cpython-36.pyc72090644editdlrm
mimetypes.cpython-36.pyc155530644editdlrm
modulefinder.cpython-36.pyc153660644editdlrm
netrc.cpython-36.pyc38360644editdlrm
nntplib.cpython-36.pyc337800644editdlrm
ntpath.cpython-36.pyc131900644editdlrm
nturl2path.cpython-36.pyc14990644editdlrm
numbers.cpython-36.pyc121420644editdlrm
opcode.cpython-36.pyc54130644editdlrm
operator.cpython-36.pyc139130644editdlrm
optparse.cpython-36.pyc480540644editdlrm
os.cpython-36.pyc296280644editdlrm
pathlib.cpython-36.pyc420070644editdlrm
pdb.cpython-36.pyc460940644editdlrm
pickle.cpython-36.pyc426910644editdlrm
pickletools.cpython-36.pyc660200644editdlrm
pipes.cpython-36.pyc78080644editdlrm
pkgutil.cpython-36.pyc162610644editdlrm
platform.cpython-36.pyc291970644editdlrm
plistlib.cpython-36.pyc280550644editdlrm
poplib.cpython-36.pyc133290644editdlrm
posixpath.cpython-36.pyc104560644editdlrm
pprint.cpython-36.pyc158240644editdlrm
profile.cpython-36.pyc139010644editdlrm
pstats.cpython-36.pyc218570644editdlrm
pty.cpython-36.pyc38610644editdlrm
pyclbr.cpython-36.pyc83650644editdlrm
pydoc.cpython-36.pyc837750644editdlrm
py_compile.cpython-36.pyc65440644editdlrm
queue.cpython-36.pyc87550644editdlrm
quopri.cpython-36.pyc57730644editdlrm
random.cpython-36.pyc193300644editdlrm
re.cpython-36.pyc140580644editdlrm
reprlib.cpython-36.pyc54000644editdlrm
rlcompleter.cpython-36.pyc57800644editdlrm
runpy.cpython-36.pyc79820644editdlrm
sched.cpython-36.pyc65640644editdlrm
secrets.cpython-36.pyc21620644editdlrm
selectors.cpython-36.pyc176970644editdlrm
shelve.cpython-36.pyc94580644editdlrm
shlex.cpython-36.pyc69700644editdlrm
shutil.cpython-36.pyc307040644editdlrm
signal.cpython-36.pyc25150644editdlrm
site.cpython-36.pyc165600644editdlrm
sitecustomize.cpython-36.pyc2120644editdlrm
smtpd.cpython-36.pyc266830644editdlrm
smtplib.cpython-36.pyc353400644editdlrm
sndhdr.cpython-36.pyc69130644editdlrm
socket.cpython-36.pyc220130644editdlrm
socketserver.cpython-36.pyc242500644editdlrm
sre_compile.cpython-36.pyc102780644editdlrm
sre_constants.cpython-36.pyc59720644editdlrm
sre_parse.cpython-36.pyc203580644editdlrm
ssl.cpython-36.pyc369390644editdlrm
stat.cpython-36.pyc38510644editdlrm
statistics.cpython-36.pyc181740644editdlrm
string.cpython-36.pyc79640644editdlrm
stringprep.cpython-36.pyc100300644editdlrm
struct.cpython-36.pyc3120644editdlrm
subprocess.cpython-36.pyc354850644editdlrm
sunau.cpython-36.pyc169380644editdlrm
symbol.cpython-36.pyc25170644editdlrm
symtable.cpython-36.pyc104280644editdlrm
sysconfig.cpython-36.pyc159160644editdlrm
tabnanny.cpython-36.pyc69750644editdlrm
tarfile.cpython-36.pyc630850644editdlrm
telnetlib.cpython-36.pyc180970644editdlrm
tempfile.cpython-36.pyc253090644editdlrm
textwrap.cpython-36.pyc136840644editdlrm
this.cpython-36.pyc12650644editdlrm
threading.cpython-36.pyc372340644editdlrm
timeit.cpython-36.pyc116030644editdlrm
token.cpython-36.pyc33200644editdlrm
tokenize.cpython-36.pyc186470644editdlrm
trace.cpython-36.pyc194950644editdlrm
traceback.cpython-36.pyc196460644editdlrm
tracemalloc.cpython-36.pyc172290644editdlrm
tty.cpython-36.pyc10720644editdlrm
turtle.cpython-36.pyc1317510644editdlrm
types.cpython-36.pyc82010644editdlrm
typing.cpython-36.pyc733060644editdlrm
uu.cpython-36.pyc34980644editdlrm
uuid.cpython-36.pyc209180644editdlrm
warnings.cpython-36.pyc132580644editdlrm
wave.cpython-36.pyc178850644editdlrm
weakref.cpython-36.pyc191430644editdlrm
webbrowser.cpython-36.pyc157970644editdlrm
xdrlib.cpython-36.pyc83020644editdlrm
zipapp.cpython-36.pyc55340644editdlrm
zipfile.cpython-36.pyc497280644editdlrm
_bootlocale.cpython-36.pyc9800644editdlrm
_collections_abc.cpython-36.pyc287970644editdlrm
_compat_pickle.cpython-36.pyc65660644editdlrm
_compression.cpython-36.pyc41040644editdlrm
_dummy_thread.cpython-36.pyc48510644editdlrm
_markupbase.cpython-36.pyc79910644editdlrm
_osx_support.cpython-36.pyc96840644editdlrm
_pydecimal.cpython-36.pyc1634020644editdlrm
_pyio.cpython-36.pyc713860644editdlrm
_sitebuiltins.cpython-36.pyc34350644editdlrm
_strptime.cpython-36.pyc159630644editdlrm
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc187790644editdlrm
_threading_local.cpython-36.pyc64250644editdlrm
_weakrefset.cpython-36.pyc78280644editdlrm
__future__.cpython-36.pyc41670644editdlrm
__phello__.foo.cpython-36.pyc1190644editdlrm
Edit: /snap/core18/2999/usr/lib/python3.6/__pycache__/csv.cpython-36.pyc (11855B)
3 Nqi4?@sLdZddlZddlmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZddlmZddlmZddlmZddd d d d d ddddddddddddddgZGdd d ZGdddeZedeGdddeZedeGd ddeZed!eGd"ddZGd#ddZyeWnek r8eZYnXGd$ddZdS)%z+ csv.py - read/write/investigate CSV files N)Error __version__writerreaderregister_dialectunregister_dialect get_dialect list_dialectsfield_size_limit QUOTE_MINIMAL QUOTE_ALLQUOTE_NONNUMERIC QUOTE_NONE__doc__)Dialect) OrderedDict)StringIOr r r rrrrexcel excel_tabr rrrrr Snifferrr DictReader DictWriter unix_dialectc@sDeZdZdZdZdZdZdZdZdZ dZ dZ dZ ddZ ddZdS) rzDescribe a CSV dialect. This must be subclassed (see csv.excel). Valid attributes are: delimiter, quotechar, escapechar, doublequote, skipinitialspace, lineterminator, quoting. FNcCs|jtkrd|_|jdS)NT) __class__r_valid _validate)selfr/usr/lib/python3.6/csv.py__init__+s zDialect.__init__cCs@y t|Wn.tk r:}ztt|WYdd}~XnXdS)N)_Dialect TypeErrorrstr)rerrrr0s zDialect._validate)__name__ __module__ __qualname__r_namer delimiter quotecharZ escapechar doublequoteskipinitialspacelineterminatorquotingr rrrrrrsc@s(eZdZdZdZdZdZdZdZe Z dS)rz;Describe the usual properties of Excel-generated CSV files.,"TFz N) r%r&r'rr)r*r+r,r-r r.rrrrr7sc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files. N)r%r&r'rr)rrrrrAsz excel-tabc@s(eZdZdZdZdZdZdZdZe Z dS)rz:Describe the usual properties of Unix-generated CSV files.r/r0TF N) r%r&r'rr)r*r+r,r-r r.rrrrrFsZunixc@s@eZdZd ddZddZeddZejd dZd d ZdS) rNrcOs6||_||_||_t||f|||_||_d|_dS)Nr) _fieldnamesrestkeyrestvalrdialectline_num)rf fieldnamesr4r5r6argskwdsrrrr Rs zDictReader.__init__cCs|S)Nr)rrrr__iter__[szDictReader.__iter__c Cs@|jdkr0yt|j|_Wntk r.YnX|jj|_|jS)N)r3nextr StopIterationr7)rrrrr9^s  zDictReader.fieldnamescCs ||_dS)N)r3)rvaluerrrr9hscCs|jdkr|jt|j}|jj|_x|gkr:t|j}q&Wtt|j|}t|j}t|}||krz||d||j<n*||krx |j|dD]}|j||<qW|S)Nr) r7r9r=rrziplenr4r5)rrowdZlfZlrkeyrrr__next__ls     zDictReader.__next__)NNNr) r%r&r'r r<propertyr9setterrErrrrrQs   c@s6eZdZdddZddZdd Zd d Zd d ZdS)rrraisercOsB||_||_|jdkr$td|||_t||f|||_dS)NrHignorez-extrasaction (%s) must be 'raise' or 'ignore')rHrI)r9r5lower ValueError extrasactionr)rr8r9r5rLr6r:r;rrrr s zDictWriter.__init__cCs tt|j|j}|j|dS)N)dictr@r9writerow)rheaderrrr writeheaderszDictWriter.writeheadercsNjdkr8jj}|r8tddjdd|DfddjDS)NrHz(dict contains fields not in fieldnames: z, cSsg|] }t|qSr)repr).0xrrr sz,DictWriter._dict_to_list..c3s|]}j|jVqdS)N)getr5)rRrD)rowdictrrr sz+DictWriter._dict_to_list..)rLkeysr9rKjoin)rrVZ wrong_fieldsr)rVrr _dict_to_lists  zDictWriter._dict_to_listcCs|jj|j|S)N)rrNrZ)rrVrrrrNszDictWriter.writerowcCs|jjt|j|S)N)r writerowsmaprZ)rZrowdictsrrrr[szDictWriter.writerowsN)rrHr)r%r&r'r rPrZrNr[rrrrrs  c@s:eZdZdZddZd ddZddZd d Zd d ZdS)rze "Sniffs" the format of a CSV file (i.e. delimiter, quotechar) Returns a Dialect object. cCsdddddg|_dS)Nr/r1; :) preferred)rrrrr szSniffer.__init__NcCsd|j||\}}}}|s(|j||\}}|s4tdGdddt}||_||_|pVd|_||_|S)zI Returns a dialect (or None) corresponding to the sample zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff..dialectZsniffedz N)r%r&r'r(r-r r.rrrrr6sr6r0)_guess_quote_and_delimiter_guess_delimiterrrr+r)r*r,)rsample delimitersr*r+r)r,r6rrrsniffs  z Sniffer.sniffcCsg}x0dD](}tj|tjtjB}|j|}|r Pq W|s>dSi}i}d}|j} x|D]} | d d } | | } | r|j| dd || <y| d d } | | } Wntk rwVYnX| r|dks| |kr|j| dd || <y| d d } Wntk rwVYnX| | rV|d 7}qVWt||jd } |rZt||jd }|||k}|dkrbd}nd}d}tjdtj || dtj}|j |rd}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. I(?P[^\w\n"\'])(?P ?)(?P["\']).*?(?P=quote)(?P=delim)G(?:^|\n)(?P["\']).*?(?P=quote)(?P[^\w\n"\'])(?P ?)G(?P[^\w\n"\'])(?P ?)(?P["\']).*?(?P=quote)(?:$|\n)-(?:^|\n)(?P["\']).*?(?P=quote)(?:$|\n)rFNrquotedelimZspace)rDr2z]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjT)rfrgrhri)rFNr) recompileDOTALL MULTILINEfindall groupindexrUKeyErrormaxescapesearch)rdatardZmatchesZrestrZregexpZquotesdelimsZspacesrrmnrDr*rlr,Z dq_regexpr+rrrras`          z"Sniffer._guess_quote_and_delimitercCsttd|jd}ddtdD}tdt|}d}i}i}i}dt|t|} } x| t|krn|d7}xT|| | D]D} x>|D]6} |j| i} | j| }| j|dd| |<| || <qWqWx|jD]} t|| j }t|dkr|dddkrqt|dkrht |d d d || <|j || || d|| dt d d |Df|| <q|d|| <qW|j }t ||}d}d}xt|dkr||krx\|D]T\}}|ddkr|ddkr|d||kr|dks||kr|||<qW|d8}qWt|dkr`t|jd}|dj||djd|k}||fS| } | |7} q\W|szdSt|dkrxF|jD]<}||jkr|dj||djd|k}||fSqWdd|j D}|j|dd}|dj||djd|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. Nr2cSsg|] }t|qSr)chr)rRcrrrrT.sz,Sniffer._guess_delimiter.. rrkcSs|dS)Nrkr)rSrrrHsz*Sniffer._guess_delimiter..)rDcss|]}|dVqdS)rkNr)rRitemrrrrWMsz+Sniffer._guess_delimiter..g?g?g{Gz?z%c rcSsg|]\}}||fqSrr)rRkvrrrrTws)rr)listfiltersplitrangeminrArUcountrXitemsrtremovesumfloatr`sort)rrwrdasciiZ chunkLengthZ iterationZ charFrequencyZmodesrxstartendlinecharZ metaFrequencyZfreqrZmodeListZtotalZ consistencyZ thresholdrrrlr,rCrrrrbst           zSniffer._guess_delimiterc Cstt||j|}t|}t|}i}xt|D] }d||<q2Wd}x|D]}|dkrZP|d7}t||krpqLxt|jD]x} xJtt t gD]0} y| || PWqt t fk rYqXqWt|| } | || kr~|| dkr| || <q~|| =q~WqLWd} x|j D]~\} } t| tdkrLt|| | krB| d7} n| d8} ns2@       2