
    -Ph+                         d Z ddlZddlZddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZmZ dd	lmZmZmZ dd
ede	ee         df         defdZd
edefdZdej        fdZdde	ee         df         defdZdS )zThe CLI for numpydoc.    N)Sequence)Path)ListUnion   )get_doc_object)utilsvalidate_docstrings)
ERROR_MSGS	Validatorvalidateimport_pathconfigreturnc                     t          t          t          j        |           t	          |pg                                dS )z6Test numpydoc docstring generation for a given object.)r   r   )printr   r   	_load_objdict)r   r   s     L/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpydoc/cli.pyrender_objectr      s<     
.,[99$v|QSBTBT
U
U
UVVV1    c                     d}t          |           }|d         D ]/\  }}|dz  }t          d                    | ||g                     0|S )z5Run numpydoc docstring validation for a given object.r   errorsr   :)r   r   join)r   exit_statusresultserr_codeerr_descs        r   validate_objectr       sa    K{##G%h/ ; ;(qchhXx899::::r   c                     t          j        dt                    } |                     d          }d }|                    ddd	          }|                    d
d           |                    dd|dd           |                    t                     |                    ddd	          } |j        d
d            |j        t                     t          j
        dg          \  }}t          j        |          }d t          t          j                              |d         z
  D             }dd                    |          z   dz   }	|                    dddt           j                  }
|
                    dt$          d d!"           |
                    dt$          d#$           |
                    d%t$          d&d'|rd(t'          |          |z   d)|	 d*nd+ "           |
                    t          j                   | S ),zu
    Build an argument parser.

    Returns
    -------
    argparse.ArgumentParser
        The argument parser.
    numpydoc)progdescriptionsubcommands)titlec                 d    |                      d          \  }}}t          j        |          }||fS )N=)	partitionastliteral_eval)skey_values       r   _parse_configz!get_parser.<locals>._parse_config+   s3    C((Q ''Ezr   renderz2Generate an expanded RST-version of the docstring.z(generate the RST docstring with numpydoc)r$   helpr   ze.g. numpy.ndarray)r2   z-cz--configappendzbkey=val where val will be parsed by literal_eval, e.g. -c use_plots=True. Multiple -c can be used.)typeactionr2   )funcr   z=Validate an object's docstring against the numpydoc standard.z1validate the object's docstring and report errors.c                 4    g | ]}d | dt           |          S )z- : )r   ).0checks     r   
<listcomp>zget_parser.<locals>.<listcomp>J   s=        	*U))j'))  r   checksz
  
lintzIRun numpydoc validation on files with option to ignore individual checks.zAvalidate all docstrings in file(s) using the abstract syntax tree)r$   r2   formatter_classfiles+z&File(s) to run numpydoc validation on.)r4   nargsr2   aC  Path to a directory containing a pyproject.toml or setup.cfg file.
The hook will look for it in the root project directory.
If both are present, only pyproject.toml will be used.
Options must be placed under
    - [tool:numpydoc_validation] for setup.cfg files and
    - [tool.numpydoc_validation] for pyproject.toml files.)r4   r2   z--ignore*zCheck codes to ignore.z' Currently ignoring the following from r9   z^Values provided here will be in addition to the above, unless an alternate config is provided. )argparseArgumentParser__doc__add_subparsers
add_parseradd_argumentset_defaultsr   r    r	   find_project_rootr
   parse_configsetr   keysr   RawTextHelpFormatterstrr   run_hook)ap
subparsersr0   r1   r   project_root_from_cwdconfig_fileconfig_optionsignored_checksignored_checks_textlint_parsers              r   
get_parserr\      s    
	 jg	F	F	FB"""77J  
 ""H7 #  F
 ,@AAA
;     ]+++$$S@ %  H
 H-.BCCCCH////).)@#)G)G&;(56KLLN **++nX.FF  N !6;;~#>#>>E''_P 5	 (  K c+S     I	      "* q-..<q q@Sq q q q (*	      "5">???Ir   argvc                    t                      }t          |                    |                     }	 |                    d          } |di |S # t          $ r- |                    d|                                           Y dS w xY w)zCLI for numpydoc.r6      )statusmessageN )r\   vars
parse_argspopKeyErrorexitformat_help)r]   rT   argsr6   s       r   mainrj   w   s    	Bd##$$D4xxt||d|| 4 4 4
q".."2"23333334s   A 3BB)N)rH   rF   r*   collections.abcr   pathlibr   typingr   r   docscrape_sphinxr   hooksr	   r
   r   r   r   rR   intr   r    rG   r\   rj   rb   r   r   <module>rq      sa      



 $ $ $ $ $ $               , , , , , , - - - - - - - - 5 5 5 5 5 5 5 5 5 5 s E$s)T/,B c         UH+ U U U Up
4 
4uXc]D() 
4S 
4 
4 
4 
4 
4 
4r   