B An]@sdZddlmZddlZddlZddlZddlmZy ddlZ Wne k r\ddl Z YnXy ddl Z Wne k rddl Z YnXyddl mZWne k rdZYnXy ddlZWne k rdZYnXyddlmZWn"e k r ddlmZYnXe Z e Z eZeZeZeedeZejd Zejd Zejd kZejdd kZejdd kZepeoejddkZere Z!e"Z#e$Z%e&Z'ddZ(nere)Z!e Z#e Z%e*Z'ddZ(ddZ+ddZ,ddZ-dddZ.ddZ/dS)z Helpers for Python and platform compatibility. To distinguish them from the builtin functions, replacement functions are suffixed with an underscore, e.g. `unicode_`. DOCS: https://spacy.io/api/top-level#compat )unicode_literalsN) copy_array)Stream) Optimizer)AdamizipwinlinuxdarwincCst|dS)Nutf8)strdecode)pathro/home/app_decipher_dev_19-4/dev/decipher-analysis/serverless-application/helper/df_spacy/python/spacy/compat.py?rcCst|S)N)r)rrrrrFrcCstr|St|ddS)zConvert a bytes object to a string. b_str (bytes): The object to convert. RETURNS (unicode): The converted string. r)encoding) is_python2r)Zb_strrrrb_to_strIsrcCs:tr,ddl}|jddt|t|gddn ||dS)zCreate a symlink. Used for model shortcut links. orig (unicode / Path): The origin path. dest (unicode / Path): The destination path of the symlink. rNZmklinkz/dT)shell) is_windows subprocesscallpath2str symlink_to)origdestrrrrrUs rcCs6tjt|r$tr$tt|ntt|dS)zjRemove a symlink. Used for model shortcut links. link (unicode / Path): The path to the symlink. N)osrisdirrrrmdirunlink)linkrrrsymlink_removecsr'cCs<|dtfko:|dtfko:|dtfko:|dtfko:|dtfkS)a$Check if a specific configuration of Python version and operating system matches the user's setup. Mostly used to display targeted error messages. python2 (bool): spaCy is executed with Python 2.x. python3 (bool): spaCy is executed with Python 3.x. windows (bool): spaCy is executed on Windows. linux (bool): spaCy is executed on Linux. osx (bool): spaCy is executed on OS X or macOS. RETURNS (bool): Whether the configuration matches the user's platform. DOCS: https://spacy.io/api/top-level#compat.is_config N)r is_python3ris_linuxis_osx)Zpython2Zpython3Zwindowsr Zosxrrr is_configps     r+cCsZt|}tr ddl}|||Sddl}|j|t|}|j|}|j ||SdS)zImport module from a file. Used to load models from a directory. name (unicode): Name of module to load. loc (unicode / Path): Path to the file. RETURNS: The loaded module. rN) ris_python_pre_3_5imp load_sourceimportlib.utilutilspec_from_file_locationrmodule_from_specloader exec_module)namelocr- importlibspecmodulerrr import_files   r:)NNNNN)0__doc__ __future__rr"sys itertoolsthinc.neural.utilrcPicklepickle ImportErrorcopy_regcopyregZcupy.cuda.streamrZ CudaStreamcupythinc.neural.optimizersrrgetattrziprplatform startswithrr)r* version_inforr(r,rbytes_unicodeunicode_ basestring basestring_ raw_inputinput_rbytesinputrrr'r+r:rrrrsl