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apshot_downloadSpaceHardwareSpaceRuntime
SpaceStageSpaceStorageSpaceVariableHFSummaryWriterWebhookPayloadWebhookPayloadCommentWebhookPayloadDiscussionWebhookPayloadDiscussionChangesWebhookPayloadEventWebhookPayloadMovedToWebhookPayloadRepoWebhookPayloadUrlWebhookPayloadWebhookWebhooksServerwebhook_endpoint
DiscussionDiscussionCommentDiscussionCommitDiscussionEventDiscussionStatusChangeDiscussionTitleChangeDiscussionWithDetailsCONFIG_NAMEFLAX_WEIGHTS_NAMEHUGGINGFACE_CO_URL_HOMEHUGGINGFACE_CO_URL_TEMPLATEPYTORCH_WEIGHTS_NAMEREPO_TYPE_DATASETREPO_TYPE_MODELREPO_TYPE_SPACETF2_WEIGHTS_NAMETF_WEIGHTS_NAME_save_pretrained_fastaifrom_pretrained_fastaipush_to_hub_fastaiHfFileMetadata_CACHED_NO_EXISTcached_downloadget_hf_file_metadatahf_hub_download
hf_hub_urltry_to_load_from_cache
CommitInfoCommitOperationCommitOperationAddCommitOperationCopyCommitOperationDeleteDatasetSearchArgumentsGitCommitInfo
GitRefInfoGitRefsHfApiModelSearchArgumentsRepoUrl	UserLikesadd_space_secretadd_space_variablechange_discussion_statuscomment_discussioncreate_branchcreate_commitcreate_commits_on_prcreate_discussioncreate_pull_requestcreate_repo
create_tagdataset_infodelete_branchdelete_filedelete_folderdelete_repodelete_space_secretdelete_space_storagedelete_space_variable
delete_tagduplicate_spaceedit_discussion_commentfile_existsget_dataset_tagsget_discussion_detailsget_full_repo_nameget_model_tagsget_repo_discussionsget_space_runtimeget_space_variablesget_token_permissionlikelist_datasetslist_files_infolist_liked_reposlist_metricslist_modelslist_repo_commitslist_repo_fileslist_repo_refslist_spacesmerge_pull_request
model_info	move_repopause_spacerename_discussionrepo_exists	repo_inforepo_type_and_id_from_hf_idrequest_space_hardwarerequest_space_storagerestart_spacerun_as_futureset_space_sleep_time
space_infosuper_squash_historyunlikeupdate_repo_visibilityupload_fileupload_folderwhoamiHfFileSystemHfFileSystemFileHfFileSystemResolvedPathModelHubMixinPyTorchModelHubMixinInferenceClientInferenceTimeoutErrorAsyncInferenceClientInferenceApiKerasModelHubMixinfrom_pretrained_keraspush_to_hub_kerassave_pretrained_kerasDatasetCard	ModelCardRepoCard	SpaceCardmetadata_eval_resultmetadata_loadmetadata_savemetadata_updateCardDataDatasetCardData
EvalResultModelCardDataSpaceCardData
RepositoryCacheNotFoundCachedFileInfoCachedRepoInfoCachedRevisionInfoCorruptedCacheExceptionDeleteCacheStrategyHFCacheInfoHfFoldercached_assets_pathconfigure_http_backenddump_environment_infoget_sessionloggingscan_cache_dirDatasetFilterModelFilter)_commit_scheduler_login_multi_commits_snapshot_download
_space_api_tensorboard_logger_webhooks_payload_webhooks_server	community	constantsfastai_utilsfile_downloadhf_apihf_file_system	hub_mixinzinference._clientz"inference._generated._async_clientinference_apikeras_mixinrepocardrepocard_data
repositoryutilszutils.endpoint_helpersc                    s   |dkri }dkrt  nt dd | D t B  fdd} fdd}tjdd	rt  B D ]}|| q||t fS )
a[  Attach lazily loaded submodules, functions, or other attributes.

    Typically, modules import submodules and attributes as follows:

    ```py
    import mysubmodule
    import anothersubmodule

    from .foo import someattr
    ```

    The idea is to replace a package's `__getattr__`, `__dir__`, and
    `__all__`, such that all imports work exactly the way they would
    with normal imports, except that the import occurs upon first use.

    The typical way to call this function, replacing the above imports, is:

    ```python
    __getattr__, __dir__, __all__ = lazy.attach(
        __name__,
        ['mysubmodule', 'anothersubmodule'],
        {'foo': ['someattr']}
    )
    ```
    This functionality requires Python 3.7 or higher.

    Args:
        package_name (`str`):
            Typically use `__name__`.
        submodules (`set`):
            List of submodules to attach.
        submod_attrs (`dict`):
            Dictionary of submodule -> list of attributes / functions.
            These attributes are imported as they are used.

    Returns:
        __getattr__, __dir__, __all__

    Nc                 S   s    i | ]\}}|D ]
}||qqS  r   ).0modattrsattrr   r   W/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/huggingface_hub/__init__.py
<dictcomp>C  s
        z_attach.<locals>.<dictcomp>c                    s   | krt  d|  S |  krn d |   }t |}t|| }|  |  krjtj }||j| < |S td d|  d S )N.zNo z attribute )	importlibimport_modulegetattrsysmodules__dict__AttributeError)nameZsubmod_pathZsubmodr   pkg)attr_to_modulespackage_name
submodulesr   r   __getattr__G  s    



z_attach.<locals>.__getattr__c                      s    S )Nr   r   )__all__r   r   __dir__Z  s    z_attach.<locals>.__dir__ZEAGER_IMPORT )setitemslistkeysosenvironget)r   r   submod_attrsr   r   r   r   )r   r   r   r   r   _attach  s    (
r   )r   r      )r   )r   r   r   r   )r   r	   )r
   )r   r   r   r   r   )r   )	r   r   r   r   r   r   r   r   r   )r   r   )r   r   r   r   r    r!   r"   )
r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   )r-   r.   r/   )r1   r0   r2   r3   r4   r5   r6   )Jr7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   )r   r   r   )r   r   )r   r   )r   )r   )r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r   r   r   )r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   )r   r   r   typingr   __version__Z_SUBMOD_ATTRSr   __name__r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r   r-   r.   r/   r   r1   r0   r2   r3   r4   r5   r6   r   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   Zinference._clientr   r   Z"inference._generated._async_clientr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zutils.endpoint_helpersr   r   r   r   r   r   <module>+   s  

M  ^Q,$	0$	 1L(
@