Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib
/
python3.5
/
site-packages
/
joblib
/
__pycache__
/
File Content:
_memory_helpers.cpython-35.pyc
��X � @ s� y d d l m Z Wn} e k r� d d l m Z m Z d d l Z d d l m Z m Z e j d � Z d d � Z d d � Z d d � Z Yn Xd S)� )�open)�lookup�BOM_UTF8N)� TextIOWrapperr zcoding[:=]\s*([-\w.]+)c C sd | d d � j � j d d � } | d k s= | j d � rA d S| d k s\ | j d � r` d S| S)z(Imitates get_normal_name in tokenizer.c.N� �_�-zutf-8zutf-8-�latin-1� iso-8859-1�iso-latin-1�latin-1-�iso-8859-1-�iso-latin-1-)r r r )r r r )�lower�replace� startswith)�orig_enc�enc� r �/_memory_helpers.py�_get_normal_name s "r c s� d � d } d } � f d d � } � f d d � } | � } | j t � rj d � | d d � } d } | sz | g f S| | � } | r� | | g f S| � } | s� | | g f S| | � } | r� | | | g f S| | | g f S)aF The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argment, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. FNzutf-8c s( y � � SWn t k r# d SYn Xd S)N� )� StopIterationr )�readliner r �read_or_stop- s z&_detect_encoding.<locals>.read_or_stopc s� y | j d � } Wn t k r+ d SYn Xt j | � } | sE d St | d � } y t | � } Wn"