
    shtW              	          S r SrSR                  \" \\5      5      rSSKrSSKr\r\R                  R                  S5      (       aP  SSK	r	\	R                  " 5       S   S   r\R                  S5      (       a  SrO(\R                  S	5      (       a  S
rOSrO\R                  rS'S jrS'S jrS'S jrS'S jrS(S jrS(S jr " S S\5      rS rS rS rS r\S:X  a   SSKr\r\"S:X  a  Sr#Sr$Sr%\&" S\-  5        \&" S5        \" \#\$S S!9r'\% H  r(\&" \(< S"\)" \'\(5      < 35        M     \&" S#5        \" \#\$5      r'\% H  r(\&" \(< S"\)" \'\(5      < 35        M     \&" S$5        \" \#5      r'\% H  r(\&" \(< S"\)" \'\(5      < 35        M     \&" S%5        \" \#SS&9r'\% H  r(\&" \(< S"\)" \'\(5      < 35        M     gg! \ a1     SSKJr  \r N! \ a     SSK r!\r  N! \ a    \r   GNf = ff = ff = f))zyUtilities for determining application-specific dirs.

See <http://github.com/ActiveState/appdirs> for details and usage.
)      r   .    Njava   Windowswin32Macdarwinlinux2Fc                    [         S:X  a  Uc  U nU=(       a    S=(       d    Sn[        R                  R                  [	        U5      5      nU (       aE  USLa!  [        R                  R                  XQU 5      nO[        R                  R                  XP5      nO[         S:X  aF  [        R                  R                  S5      nU (       a  [        R                  R                  XP5      nOZ[        R                  " S[        R                  R                  S5      5      nU (       a  [        R                  R                  XP5      nU (       a&  U(       a  [        R                  R                  XR5      nU$ )	a  Return full path to the user-specific data dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "roaming" (boolean, default False) can be set True to use the Windows
        roaming appdata directory. That means that for users on a Windows
        network setup for roaming profiles, this user data will be
        sync'd on login. See
        <http://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>
        for a discussion of issues.

Typical user data directories are:
    Mac OS X:               ~/Library/Application Support/<AppName>
    Unix:                   ~/.local/share/<AppName>    # or in $XDG_DATA_HOME, if defined
    Win XP (not roaming):   C:\Documents and Settings\<username>\Application Data\<AppAuthor>\<AppName>
    Win XP (roaming):       C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>
    Win 7  (not roaming):   C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName>
    Win 7  (roaming):       C:\Users\<username>\AppData\Roaming\<AppAuthor>\<AppName>

For Unix, we follow the XDG spec and support $XDG_DATA_HOME.
That means, by default "~/.local/share/<AppName>".
r	   CSIDL_APPDATACSIDL_LOCAL_APPDATAFr   z~/Library/Application Support/XDG_DATA_HOMEz~/.local/sharesystemospathnormpath_get_win_folderjoin
expandusergetenv)appname	appauthorversionroamingconstr   s         f/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/misc/appdirs.pyuser_data_dirr    *   s    @ I+OD/Dww 67%ww||DW=ww||D2	8	ww!!"BC77<<.Dyy"''*<*<=M*NO77<<.D7ww||D*K    c                 x   [         S:X  a|  Uc  U n[        R                  R                  [	        S5      5      nU (       aF  USLa"  [        R                  R                  XAU 5      nGO[        R                  R                  X@5      nGO|[         S:X  aG  [        R                  R                  S5      nU (       a  [        R                  R                  X@5      nGO+[        R                  " S[        R                  R                  SS/5      5      nUR                  [        R                  5       Vs/ s H?  n[        R                  R                  UR                  [        R                  5      5      PMA     nnU (       aV  U(       a  [        R                  R                  X5      n U Vs/ s H#  n[        R                  R                  XP/5      PM%     nnU(       a!  [        R                  R                  U5      nU$ US	   nU$ U (       a&  U(       a  [        R                  R                  XB5      nU$ s  snf s  snf )
a  Return full path to the user-shared data dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "multipath" is an optional parameter only applicable to *nix
        which indicates that the entire list of data dirs should be
        returned. By default, the first item from XDG_DATA_DIRS is
        returned, or '/usr/local/share/<AppName>',
        if XDG_DATA_DIRS is not set

Typical user data directories are:
    Mac OS X:   /Library/Application Support/<AppName>
    Unix:       /usr/local/share/<AppName> or /usr/share/<AppName>
    Win XP:     C:\Documents and Settings\All Users\Application Data\<AppAuthor>\<AppName>
    Vista:      (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.)
    Win 7:      C:\ProgramData\<AppAuthor>\<AppName>   # Hidden, but writeable on Win 7.

For Unix, this is using the $XDG_DATA_DIRS[0] default.

WARNING: Do not use this on Windows. See the Vista-Fail note above for why.
r	   CSIDL_COMMON_APPDATAFr   z/Library/Application SupportXDG_DATA_DIRSz/usr/local/sharez
/usr/sharer   )r   r   r   r   r   r   r   r   pathsepsplitrstripsepr   r   r   	multipathr   xpathlists          r   site_data_dirr-   a   s   > Iww0F GH%ww||DW=ww||D2	8	ww!!"@A77<<.D yy*<l)KLNBF**RZZBXYBXQBGG&&qxx'78BXY'',,w8;CD8aQL18HD::??8,D  A;D7ww||D*K Z Es   /AH2(*H7c                 D   [         S;   a  [        XSU5      nOZ[        R                  " S[        R                  R                  S5      5      nU (       a  [        R                  R                  X@5      nU (       a&  U(       a  [        R                  R                  XB5      nU$ )ar  Return full path to the user-specific config dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "roaming" (boolean, default False) can be set True to use the Windows
        roaming appdata directory. That means that for users on a Windows
        network setup for roaming profiles, this user data will be
        sync'd on login. See
        <http://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>
        for a discussion of issues.

Typical user data directories are:
    Mac OS X:               same as user_data_dir
    Unix:                   ~/.config/<AppName>     # or in $XDG_CONFIG_HOME, if defined
    Win *:                  same as user_data_dir

For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME.
That means, by default "~/.config/<AppName>".
r	   r   NXDG_CONFIG_HOMEz	~/.config)r   r    r   r   r   r   r   )r   r   r   r   r   s        r   user_config_dirr1      sl    : $$Ww?yy*BGG,>,>{,KL77<<.D7ww||D*Kr!   c                    [         S;   a:  [        X5      nU (       a&  U(       a  [        R                  R	                  XB5      nU$ [        R
                  " SS5      nUR                  [        R                  5       Vs/ s H?  n[        R                  R                  UR                  [        R                  5      5      PMA     nnU (       aV  U(       a  [        R                  R	                  X5      n U Vs/ s H#  n[        R                  R	                  XP/5      PM%     nnU(       a!  [        R                  R	                  U5      nU$ US   nU$ s  snf s  snf )a  Return full path to the user-shared data dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "multipath" is an optional parameter only applicable to *nix
        which indicates that the entire list of config dirs should be
        returned. By default, the first item from XDG_CONFIG_DIRS is
        returned, or '/etc/xdg/<AppName>', if XDG_CONFIG_DIRS is not set

Typical user data directories are:
    Mac OS X:   same as site_data_dir
    Unix:       /etc/xdg/<AppName> or $XDG_CONFIG_DIRS[i]/<AppName> for each value in
                $XDG_CONFIG_DIRS
    Win *:      same as site_data_dir
    Vista:      (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.)

For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False

WARNING: Do not use this on Windows. See the Vista-Fail note above for why.
r/   XDG_CONFIG_DIRSz/etc/xdgr   )r   r-   r   r   r   r   r&   r%   r   r'   r(   r)   s          r   site_config_dirr4      s    < $$W0w77<<.D K yy*J7BF**RZZBXYBXQBGG&&qxx'78BXY'',,w8;CD8aQL18HD::??8,D K A;DK Z Es   =AE6*Ec                 
   [         S:X  a  Uc  U n[        R                  R                  [	        S5      5      nU (       al  USLa!  [        R                  R                  XAU 5      nO[        R                  R                  X@5      nU(       a   [        R                  R                  US5      nO[         S:X  aF  [        R                  R                  S5      nU (       a  [        R                  R                  X@5      nOZ[        R                  " S[        R                  R                  S5      5      nU (       a  [        R                  R                  X@5      nU (       a&  U(       a  [        R                  R                  XB5      nU$ )	a  Return full path to the user-specific cache dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "opinion" (boolean) can be False to disable the appending of
        "Cache" to the base app data dir for Windows. See
        discussion below.

Typical user cache directories are:
    Mac OS X:   ~/Library/Caches/<AppName>
    Unix:       ~/.cache/<AppName> (XDG default)
    Win XP:     C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>\Cache
    Vista:      C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName>\Cache

On Windows the only suggestion in the MSDN docs is that local settings go in
the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming
app data dir (the default returned by `user_data_dir` above). Apps typically
put cache data somewhere *under* the given dir here. Some examples:
    ...\Mozilla\Firefox\Profiles\<ProfileName>\Cache
    ...\Acme\SuperApp\Cache\1.0
OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value.
This can be disabled with the `opinion=False` option.
r	   r   FCacher   z~/Library/CachesXDG_CACHE_HOMEz~/.cacher   r   r   r   opinionr   s        r   user_cache_dirr:      s    B Iww0E FG%ww||DW=ww||D2ww||D'2	8	ww!!"4577<<.Dyy)277+=+=j+IJ77<<.D7ww||D*Kr!   c                    [         S:X  a>  [        R                  R                  [        R                  R	                  S5      U 5      nOu[         S:X  a6  [        XU5      nSnU(       a   [        R                  R                  US5      nO5[        XU5      nSnU(       a   [        R                  R                  US5      nU (       a&  U(       a  [        R                  R                  XB5      nU$ )aW  Return full path to the user-specific log dir for this application.

    "appname" is the name of application.
        If None, just the system directory is returned.
    "appauthor" (only used on Windows) is the name of the
        appauthor or distributing body for this application. Typically
        it is the owning company name. This falls back to appname. You may
        pass False to disable it.
    "version" is an optional version path element to append to the
        path. You might want to use this if you want multiple versions
        of your app to be able to run independently. If used, this
        would typically be "<major>.<minor>".
        Only applied when appname is present.
    "opinion" (boolean) can be False to disable the appending of
        "Logs" to the base app data dir for Windows, and "log" to the
        base cache dir for Unix. See discussion below.

Typical user cache directories are:
    Mac OS X:   ~/Library/Logs/<AppName>
    Unix:       ~/.cache/<AppName>/log  # or under $XDG_CACHE_HOME if defined
    Win XP:     C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>\Logs
    Vista:      C:\Users\<username>\AppData\Local\<AppAuthor>\<AppName>\Logs

On Windows the only suggestion in the MSDN docs is that local settings
go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in
examples of what some windows apps use for a logs dir.)

OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA`
value for Windows and appends "log" to the user cache dir for Unix.
This can be disabled with the `opinion=False` option.
r   z~/Library/Logsr	   FLogslog)r   r   r   r   r   r    r:   r8   s        r   user_log_dirr>   7  s    @ ww||GG/0 
7	W977<<f-Dg':77<<e,D7ww||D*Kr!   c                       \ rS rSrSr  SS jr\S 5       r\S 5       r\S 5       r	\S 5       r
\S	 5       r\S
 5       rSrg)AppDirsij  z1Convenience wrapper for getting application dirs.Nc                 @    Xl         X l        X0l        X@l        XPl        g )N)r   r   r   r   r*   )selfr   r   r   r   r*   s         r   __init__AppDirs.__init__l  s    ""r!   c                 j    [        U R                  U R                  U R                  U R                  S9$ N)r   r   )r    r   r   r   r   rB   s    r   r    AppDirs.user_data_dirt  s*    T\\4>>%)\\4<<I 	Ir!   c                 j    [        U R                  U R                  U R                  U R                  S9$ N)r   r*   )r-   r   r   r   r*   rG   s    r   r-   AppDirs.site_data_diry  s*    T\\4>>%)\\T^^M 	Mr!   c                 j    [        U R                  U R                  U R                  U R                  S9$ rF   )r1   r   r   r   r   rG   s    r   r1   AppDirs.user_config_dir~  s*    t||T^^'+||T\\K 	Kr!   c                 j    [        U R                  U R                  U R                  U R                  S9$ rJ   )r4   r   r   r   r*   rG   s    r   r4   AppDirs.site_config_dir  s*    t||T^^%)\\T^^M 	Mr!   c                 T    [        U R                  U R                  U R                  S9$ Nr   )r:   r   r   r   rG   s    r   r:   AppDirs.user_cache_dir  s"    dllDNN&*ll4 	4r!   c                 T    [        U R                  U R                  U R                  S9$ rQ   )r>   r   r   r   rG   s    r   r>   AppDirs.user_log_dir  s"    DLL$..$(LL2 	2r!   )r   r   r*   r   r   )NNFF)__name__
__module____qualname____firstlineno____doc__rC   propertyr    r-   r1   r4   r:   r>   __static_attributes__ r!   r   r@   r@   j  s    ;FK # I I M M K K M M 4 4 2 2r!   r@   c                 ~    SSK nSSSS.U    nUR                  UR                  S5      nUR                  X25      u  pEU$ )zThis is a fallback technique at best. I'm not sure if using the
registry for this guarantees us the correct answer for all CSIDL_*
names.
r   NAppDatazCommon AppDatazLocal AppDatar   r#   r   z@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)winregOpenKeyHKEY_CURRENT_USERQueryValueEx)
csidl_name_winregshell_folder_namekeydirtypes         r   _get_win_folder_from_registryrk     sY    
  # 0. 	 //!!KC $$S<ICJr!   c                 (   SSK JnJn  UR                  S[	        X5      SS5      n [        U5      nSnU H  n[        U5      S:  d  M  Sn  O   U(       a   SS KnUR                  U5      nU$  U$ ! [         a     U$ f = f! [         a     U$ f = f)Nr   )shellconshellF   T)win32com.shellrm   rn   SHGetFolderPathgetattrunicodeordwin32apiGetShortPathNameImportErrorUnicodeError)re   rm   rn   ri   has_high_charcru   s          r   _get_win_folder_with_pywin32r{     s    .


78#@!Q
GCcl A1v| $  //4
 J  J	   J	 Js5   B 
B A2 2
B <B ?B  B 
BBc                    SS K nSSSS.U    nUR                  S5      nUR                  R                  R	                  S US SU5        SnU H  n[        U5      S:  d  M  S	n  O   U(       aI  UR                  S5      nUR                  R                  R                  UR                  US5      (       a  UnUR                  $ )
Nr      #      r`   i   Fro   T)	ctypescreate_unicode_bufferwindllshell32SHGetFolderPathWrt   kernel32GetShortPathNameWvalue)re   r   csidl_constbufry   rz   buf2s          r   _get_win_folder_with_ctypesr     s      "! 	K 
&
&t
,C
MM**4dAsK Mq6C< M  ++D1==!!33CIItTJJC99r!   c                    SS K nSSKJn  SSKJn  UR
                  R                  S-  nUR                  SU5      nUR                  R                  nUR                  S [        UR                  U 5      S UR                  R                  U5        UR                  R                  UR!                  5       5      R#                  S5      nSnU H  n	[%        U	5      S:  d  M  S	n  O   U(       aw  UR                  SU5      nUR&                  R                  n
U
R)                  XuU5      (       a8  UR                  R                  UR!                  5       5      R#                  S5      nU$ )
Nr   )jna)r	      rz    Fro   T)arraycom.sunr   com.sun.jna.platformr	   WinDefMAX_PATHzerosShell32INSTANCErq   rr   ShlObjSHGFP_TYPE_CURRENTNativetoStringtostringr'   rt   Kernel32rv   )re   r   r   r	   buf_sizer   rn   ri   ry   rz   kernels              r   _get_win_folder_with_jnar     s   *||$$q(H
++c8
$CMM""E	$j A4IhIhjmn
**

clln
-
4
4T
:C Mq6C< M  kk#x(((""3X66**%%clln5<<TBCJr!   )r   __main__MyApp	MyCompany)r    r-   r1   r4   r:   r>   z-- app dirs %s --z%-- app dirs (with optional 'version')z1.0rR   z: z)
-- app dirs (without optional 'version')z+
-- app dirs (without optional 'appauthor')z(
-- app dirs (with disabled 'appauthor'))r   )NNNF)NNNT)*rZ   __version_info__r   mapstr__version__sysr   rs   platform
startswithjava_veros_namer   r    r-   r1   r4   r:   r>   objectr@   rk   r{   r   r   rp   win32comr   rw   r   r   com.sun.jnacomrV   r   r   propsprintdirsproprr   r]   r!   r   <module>r      sV    hhs3 012  	
<<6""!!$Q'G)$$			E	"	"
 \\F4n?D%P0f6r0f&2f &2V*644 
W@6 zGI/E 


+,	
127Iu5D$d 345  

677I&D$d 345  

897D$d 345  

567e,D$d 345 7   	@	@%9O 	@@"": @"?@		@		@sH   F: :G1GG-GG1G)#G-$G1(G))G--G1