~L i^f dZ dZedejdDZddlZddlZeZejjdrFddl Z e jddZ e jdrd Z n#e jd rd Z nd Z n ejZ d*dZd*dZd*dZd*dZd+dZd*dZd+dZGddeZdZdZdZdZe d k(r ddlZeZe#dk(rdZ$dZ%dZ&e'd ed!e'd"ee$e%d#$Z(e&D]Z)e'e)d%e*e(e)e'd&ee$e%Z(e&D]Z)e'e)d%e*e(e)e'd'ee$Z(e&D]Z)e'e)d%e*e(e)e'd(ee$d )Z(e&D]Z)e'e)d%e*e(e)yy#e$r- ddlm Z eZn #e$r ddl!Z"eZn #e$reZYnwxYwYnwxYwYwxYw),a  This file is directly from https://github.com/ActiveState/appdirs/blob/3fe6a83776843a46f20c2e5587afcffe05e03b39/appdirs.py The license of https://github.com/ActiveState/appdirs copied below: # This is the MIT license Copyright (c) 2010 ActiveState Software Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. z1.4.4c#2K|]}t|ywN)int).0segments T/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/_appdirs.py r1sL'WLs.NjavaWindowswin32Macdarwinlinux2Fctdk(r||}|xrdxsd}tjjt |}|r|dur"tjj |||}ntjj ||}ntdk(rBtjj d}|rvtjj ||}nUtjdtjj d}|r tjj ||}|r"|r tjj ||}|S) aJReturn 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 ".". 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 for a discussion of issues. Typical user data directories are: Mac OS X: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ Win 7 (not roaming): C:\Users\\AppData\Local\\ Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. That means, by default "~/.local/share/". r CSIDL_APPDATACSIDL_LOCAL_APPDATAFrz~/Library/Application Support/ XDG_DATA_HOMEz~/.local/sharesystemospathnormpath_get_win_folderjoin expandusergetenv)appname appauthorversionroamingconstrs r user_data_dirr$Ks@  I+OD/Dww 67 %ww||D)W=ww||D'2 8 ww!!"BC 77<<g.Dyy"''*<*<=M*NO 77<<g.D7ww||D'* Kc,tdk(rx||}tjjt d}|r|dur#tjj |||}ntjj ||}ndtdk(rDtjj d}|r9tjj ||}ntjdtjj ddg}|jtjDcgc]>}tjj |jtj@}}|rP|r tjj ||}|Dcgc]#}tjj ||g%}}|r!tjj |}|S|d }|S|r"|r tjj ||}|Scc}wcc}w) aiReturn 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 ".". 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/', if XDG_DATA_DIRS is not set Typical site data directories are: Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) Win 7: C:\ProgramData\\ # 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. rCSIDL_COMMON_APPDATAFrz/Library/Application Support XDG_DATA_DIRSz/usr/local/sharez /usr/sharer ) rrrrrrrrpathsepsplitrstripseprr r! multipathrxpathlists r site_data_dirr1s>  Iww0F GH %ww||D)W=ww||D'2 8 ww!!"@A 77<<g.Dyy RZZ__.@,-OP ;?**RZZ:P 56BGG  qxx/ 0   '',,w8;CDa QL1DHD ::??8,D A;D 7ww||D'* K! Es %AH (Hctdk(rt||d|}ntdk(rBtjj d}|rvtjj ||}nUtj dtjj d}|r tjj ||}|r"|r tjj ||}|S)aReturn 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 ".". 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 for a discussion of issues. Typical user config directories are: Mac OS X: ~/Library/Preferences/ Unix: ~/.config/ # 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/". rNrz~/Library/Preferences/XDG_CONFIG_HOMEz ~/.config)rr$rrrrrrr r!r"rs ruser_config_dirr5s:Wiw? 8 ww!!":; 77<<g.Dyy*BGG,>,>{,KL 77<<g.D7ww||D'* Kr%ctdk(r2t||}|r"|r tjj ||}|Stdk(rCtjj d}|r tjj ||}|Stj dd}|jtjDcgc]>}tjj |jtj@}}|rP|r tjj ||}|Dcgc]#}tjj ||g%}}|r!tjj |}|S|d}|Scc}wcc}w)aReturn 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 ".". 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/', if XDG_CONFIG_DIRS is not set Typical site config directories are: Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ 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. rrz/Library/PreferencesXDG_CONFIG_DIRSz/etc/xdgr ) rr1rrrrrr*r)r+r,r-s rsite_config_dirr8sB<Wi0 w77<<g.D* K) 8 ww!!"89 77<<g.D" Kyy*J7:>**RZZ:P 56BGG  qxx/ 0   '',,w8;CDa QL1DHD ::??8,D KA;D K Es ?AF,(Fctdk(r||}tjjt d}|r |dur"tjj |||}n tjj ||}|rtjj |d}ntdk(rBtjj d}|rvtjj ||}nUtjdtjj d}|r tjj ||}|r"|r tjj ||}|S) aReturn 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 ".". 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/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\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\\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. rrFCacherz~/Library/CachesXDG_CACHE_HOMEz~/.cacherrr r!opinionrs ruser_cache_dirr>,sB  Iww0E FG %ww||D)W=ww||D'2ww||D'2 8 ww!!"45 77<<g.Dyy)277+=+=j+IJ 77<<g.D7ww||D'* Kr%c&tdvrt||d|}nUtjdtjj d}|r tjj ||}|r"|r tjj ||}|S)aReturn full path to the user-specific state 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 ".". 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 for a discussion of issues. Typical user state directories are: Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir For Unix, we follow this Debian proposal to extend the XDG spec and support $XDG_STATE_HOME. That means, by default "~/.local/state/". )rrNXDG_STATE_HOMEz~/.local/state)rr$rrrrrr4s ruser_state_dirrAess>$$Wiw?yy)277+=+=>N+OP 77<<g.D7ww||D'* Kr%ctdk(r>tjjtjj d|}nltdk(r2t |||}d}|rRtjj|d}n1t |||}d}|r tjj|d}|r"|r tjj||}|S)aReturn 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 ".". 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 log directories are: Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\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. rz~/Library/LogsrFLogslog)rrrrrr$r>r<s r user_log_dirrEs@ww||BGG../?@'J 7 Wi9 77<<f-Dgy': 77<<e,D7ww||D'* Kr%ceZdZdZ d dZedZedZedZedZ edZ ed Z ed Z y) AppDirsz1Convenience wrapper for getting application dirs.NcJ||_||_||_||_||_yr)rr r!r"r.)selfrr r!r"r.s r__init__zAppDirs.__init__s' "  "r%cpt|j|j|j|jSN)r!r")r$rr r!r"rIs rr$zAppDirs.user_data_dirs( LL$..$,,   r%cpt|j|j|j|jSN)r!r.)r1rr r!r.rMs rr1zAppDirs.site_data_dirs( LL$..$,,$..  r%cpt|j|j|j|jSrL)r5rr r!r"rMs rr5zAppDirs.user_config_dirs( LL$..$,,   r%cpt|j|j|j|jSrO)r8rr r!r.rMs rr8zAppDirs.site_config_dirs( LL$..$,,$..  r%cZt|j|j|jSNr!)r>rr r!rMs rr>zAppDirs.user_cache_dirdllDNNDLLQQr%cZt|j|j|jSrS)rArr r!rMs rrAzAppDirs.user_state_dirrUr%cZt|j|j|jSrS)rErr r!rMs rrEzAppDirs.user_log_dirsDLL$..$,,OOr%)NNNFF) __name__ __module__ __qualname____doc__rJpropertyr$r1r5r8r>rArEr%rrGrGs;TY#        RRRRPPr%rGcddl}dddd|}|j|jd}|j||\}}|S)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 NAppDatazCommon AppDataz Local AppDatarr'rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)winregOpenKeyHKEY_CURRENT_USER QueryValueEx) csidl_name_winregshell_folder_namekeydir_types r_get_win_folder_from_registryrks^ # 0.  //!!K C%%c+<=JC Jr%cddlm}m}|jdt ||dd} t |}d}|D]}t |dkDsd}n|r ddl}|j|}|S |S#t$rY|SwxYw#t$rY|SwxYw)Nr )shellshellconFT) win32com.shellrmrnSHGetFolderPathgetattrunicodeordwin32apiGetShortPathName ImportError UnicodeError)rermrnri has_high_charcrus r_get_win_folder_with_pywin32r{ s.   78Z#@!Q GC cl  A1v| $    //4 J  J   J     J s5 A; A;A++ A84A;7A88A;; BBcjddl}dddd|}|jd}|jjj d|dd|d}|D]}t |dkDsd }n|rD|jd}|jj j|j|dr|}|jS) Nr #r`iFroT) ctypescreate_unicode_bufferwindllshell32SHGetFolderPathWrtkernel32GetShortPathNameWvalue)rer csidl_constbufryrzbuf2s r_get_win_folder_with_ctypesr&s "! K  & &t ,C MM**4dAsKM  q6C< M ++D1 == ! ! 3 3CIItT JC 99r%cddl}ddlm}ddlm}|j j dz}|jd|}|jj}|jdt|j|d|jj||jj|j!j#d}d}|D]} t%| dkDsd }n|rs|jd|}|j&j} | j)|||r8|jj|j!j#d}|S) Nr )jna)rrzFroT)arraycom.sunrcom.sun.jna.platformrWinDefMAX_PATHzerosShell32INSTANCErqrrShlObjSHGFP_TYPE_CURRENTNativetoStringtostringr+rtKernel32rv) rerrrbuf_sizerrmriryrzkernels r_get_win_folder_with_jnarAs *||$$q(H ++c8 $C MM " "E   j)  ''  **  clln - 4 4T :CM  q6C< M kk#x(((  " "3X 6**%%clln5<rArEr1r8z -- app dirs z --z%-- app dirs (with optional 'version')z1.0rTz: z) -- app dirs (without optional 'version')z+ -- app dirs (without optional 'appauthor')z( -- app dirs (with disabled 'appauthor'))r )NNNF)NNNT)+r[ __version__tupler*__version_info__rsysstrrsplatform startswithjava_veros_namerr$r1r5r8r>rArEobjectrGrkr{rrrpwin32comrrwrr com.sun.jnacomrXrr propsprintdirsproprrr]r%rrs> L[5F5Fs5KLL  <<6"h!!$Q'G)$   E "  \\F4nBJ)X6r6r'T.b.Pf.Ph*:6D W@6" zGI E L S )* 12 7Iu 5D0 bt,-./0 67 7I &D0 bt,-./0 89 7 D0 bt,-./0 56 7e ,D0 bt,-./0C!  @ @ %9O @ @"": @"? @  @ @sZF%%G+F43G4G:GGG G G  GGGGG