B An]g @sddlmZddlZddlZddlmZddlmZddlZddl m Z m Z m Z ddl mZddl mZejd d defd d d efdddddZddZdddZdS))unicode_literalsN)Path)Printer)path2str basestring_unicode_)util)aboutzOptional shortcut link of model positionalz#Generate Markdown for GitHub issuesflagZmd)z"Don't print anything (just return)r s)modelmarkdownsilentFc Cs(t}|rt|r t|}n t|}|d}|sL|jd|ddt|}| |krt ||d<t | |d<n t ||d<|sd |}dd | D}|rt ||d n|j||d |Stjt ttjjtttd } |s$d }|rt | |d n|j| |d | S) z Print info about spaCy installation. If a model shortcut link is speficied as an argument, print model information. Flag --markdown prints details in Markdown for easy copy-pasting to GitHub issues. z meta.jsonzCan't find model meta.json)exitslinksourcezInfo about model '{}'cSsi|]\}}|dkr||qS))ZaccuracyZspeed).0kvrrq/home/app_decipher_dev_19-4/dev/decipher-analysis/serverless-application/helper/df_spacy/python/spacy/cli/info.py +szinfo..)title)z spaCy versionZLocationZPlatformzPython versionZModelszInfo about spaCy)rr is_packageget_package_path get_data_pathis_filefailsrsly read_jsonresolverformatitemsprint_markdowntabler __version__r__file__parentplatformpython_version list_models) rrrmsg model_path meta_pathmetarZ model_metadatarrrinfos@           r3csBddt}|r>dd|D}dfdd|DSdS)NcSsd}||kp|dS)N)cachepycache __pycache__.) startswith)dir_nameexcluderrr exclude_dirDsz list_models..exclude_dircSsg|]}|r|jdqS))is_dirparts)rfrrr Kszlist_models..z, csg|]}|s|qSrr)rm)r;rrr@Ls-)r riterdirjoin) data_pathmodelsr)r;rr-Cs r-cCsrg}xB|D]6\}}t|tr.t|r.q|d|t|qW|rZtd|tdd |dS)zPrint data in GitHub-flavoured Markdown format for issues etc. data (dict or list of tuples): Label/value pairs. title (unicode or None): Title, will be rendered as headline 2. z * **{}:** {}z ## {}z {}  N) r% isinstancerrexistsappendr$rprintrD)r2rrkeyvaluerrrr&Psr&)NFF)N) __future__rplacr+pathlibrwasabirr!compatrrrr r annotationsstrr3r-r&rrrrs        /