
    iX                         d dl mZmZ d dlmZ d dlmZ ddlmZ ddl	m
Z
mZmZ  ej                  d       e
d	d
       edddd      fdedee   fd       Zdededeeef   fdZy)    )OptionalTuple)RegistryError)msg   )registry   )ArgOptappzfind-function.z Name of the registered function.)helpNz
--registryz-rzName of the catalogue registry.	func_nameregistry_namec                     |s5t        j                         }|D ]  }t        j                  ||       s|} n |st        j                  d|  dd       |J t        | |       y)a   
    Find the module, path and line number to the file the registered
    function is defined in, if available.

    func_name (str): Name of the registered function.
    registry_name (Optional[str]): Name of the catalogue registry.

    DOCS: https://spacy.io/api/cli#find-function
    $Couldn't find registered function: ''r	   exitsN)r   get_registry_nameshasr   failfind_function)r   r   registry_namesnames       h/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/spacy/cli/find_function.pyfind_function_clir   
   sr    $ !446" 	D||D), $	
 29+Q?	

 $$$)]+    returnc                    d }	 t        j                  ||       }|J d }d }|d   r
|d   }|d   }|r|st        j                  d|  d| dd       |J |J t        j
                  d	|  d
| d|        t        |      t        |      fS # t        $ r>}t        j                  d|  d| d       t        j                  | d       Y d }~d }~ww xY w)Nr   z' in registry 'r   r	   r   fileline_noz,Couldn't find path to registered function: 'zFound registered function 'z' at :)r   findr   r   r   goodstrint)r   r   registry_desceregistry_pathr!   s         r   r   r   -   s   M" mY? $$$MGV%f-	*:9+_UbTccde	
 $$$HH*9+U=/7)TU}s7|++-  "29+_]O[\]	
 	A3q!!	"s   B 	C4CC)typingr   r   	cataloguer   wasabir   utilr   _utilr
   r   r   commandr%   r   r&   r    r   r   <module>r1      s    " #       _ #EF#&lD'H$,, C=, ,D,S , ,sCx ,r   