o
    2h                     @   s   G d d dZ dS )c                   @   s    e Zd ZdZdd Zdd ZdS )exporta!  Decorator to export a public API in a given package.

    Example usage:

    ```python
    @export(package="keras_tuner", path="keras_tuner.applications.HyperResNet")
    class HyperResNet:
        ...
    ```

    You can also pass a list of paths as `path`, to make
    the same symbol visible under various aliases:

    ```python
    @export(
        package="keras_tuner",
        path=[
            "keras_tuner.applications.HyperResNet",
            "keras_tuner.applications.resnet.HyperResNet",
        ])
    class HyperResNet:
        ...
    ```

    **Note:** All export packages must start with the package name.
    Yes, that is redundant, but that is a helpful sanity check.
    The expectation is that each package will customize
    `export_api` to provide a default value for `package`,
    which will serve to validate all `path` values
    and avoid users inadvertendly ending up with non-exported
    symbols due to a bad path (e.g. `path="applications.HyperResNet"`
    instead of `path="keras_tuner.applications.HyperResNet"`).
    c                 C   sv   t |tr	|g}nt |tr|}ntd| dt| |D ]}||d s2td| d| q|| _|| _d S )Nz,Invalid type for `path` argument: Received 'z
' of type .z,All `export_path` values should start with 'z.'. Received: path=)
isinstancestrlist
ValueErrortype
startswithpackagepath)selfr	   r
   export_pathsp r   G/var/www/html/chatgem/venv/lib/python3.10/site-packages/namex/export.py__init__$   s*   


zexport.__init__c                 C   sN   t |dr|jt|krtd| d|j d| j d| j|_t||_|S )N_api_export_pathzSymbol z is already exported as 'z'. Cannot also export it to 'z'.)hasattr_api_export_symbol_ididr   r   r
   )r   symbolr   r   r   __call__:   s   
zexport.__call__N)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s    "r   N)r   r   r   r   r   <module>   s    