
    Y j              	          S r SSKrSSKrSSKJr  SSKJrJr  \R                  " S\R                  \R                  -  \R                  -  S9rSS	\S-  S
\\   4S jjrSS\S\S	\S-  S
S4S jjrSS\S	\S-  S
S4S jjrS\S
\\   4S jrg)z-Contains utilities to manage Git credentials.    N   )ENDPOINT   )run_interactive_subprocessrun_subprocessz
        ^\s* # start of line
        credential\.helper # credential.helper value
        \s*=\s* # separator
        ([\w\-\/]+) # the helper name or absolute path (group 1)
        (\s|$) # whitespace or end of line
    )flagsfolderreturnc                      [        SU S9R                  n[        U5      nU$ ! [        R                   a  n[        UR                  5      eSnAff = f)aw  Return the list of git credential helpers configured.

See https://git-scm.com/docs/gitcredentials.

Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

Args:
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit config --listr	   N)r   stdout_parse_credential_output
subprocessCalledProcessErrorOSErrorstderr)r	   outputparsedexcs       v/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/huggingface_hub/utils/_git_credential.pylist_credential_helpersr   #   sN    " 3FCJJ)&1(( "cjj!!"s    # AAAtokenusernamec           
          [        SUS9 u  nnUR                  S[         SUR                  5        SU  S35        UR	                  5         SSS5        g! , (       d  f       g= f)a  Save a username/token pair in git credential for HF Hub registry.

Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

Args:
    username (`str`, defaults to `"hf_user"`):
        A git username. Defaults to `"hf_user"`, the default user used in the Hub.
    token (`str`, defaults to `"hf_user"`):
        A git password. In practice, the User Access Token for the Hub.
        See https://huggingface.co/settings/tokens.
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit credential approver   url=z

username=z

password=z

N)r   writer   lowerflush)r   r   r	   stdin_s        r   set_git_credentialr!   7   s[     
$$<V	L Q	d8*K0@/AUGSWXY 
M	L	Ls   AA
A#c                     [        SUS9 u  nnS[         S3nU b  USU R                  5        S3-  nUS-  nUR                  U5        UR	                  5         SSS5        g! , (       d  f       g= f)a1  Erase credentials from git credential for HF Hub registry.

Credentials are erased from the configured helpers (store, cache, macOS
keychain,...), if any. If `username` is not provided, any credential configured for
HF Hub endpoint is erased.
Calls "`git credential erase`" internally. See https://git-scm.com/docs/git-credential.

Args:
    username (`str`, defaults to `"hf_user"`):
        A git username. Defaults to `"hf_user"`, the default user used in the Hub.
    folder (`str`, *optional*):
        The folder in which to check the configured helpers.
zgit credential rejectr   r   
Nz	username=)r   r   r   r   r   )r   r	   r   r    standard_inputs        r   unset_git_credentialr%   N   sv     
$$;F	K P	z,	(..*:);2>>N$N# 
L	K	Ks   AA""
A0r   c                 n    [        [        R                  U 5       Vs1 s H  oS   iM	     sn5      $ s  snf )zParse the output of `git credential fill` to extract the password.

Args:
    output (`str`):
        The output of `git credential fill`.
r   )sortedGIT_CREDENTIAL_REGEXfindall)r   matchs     r   r   r   i   s;     "6">">v"F	
"F!H"F	
 	
s   2)N)hf_userN)__doc__rer   	constantsr   _subprocessr   r   compile	MULTILINE
IGNORECASEVERBOSEr(   strlistr   r!   r%   r        r   <module>r8      s    4 	    C zz ,,
&
3	 "C$J "$s) "(c S cDj \` .3 C$J RV 6S T#Y r7   