?ĄëPNG  IHDR ? f ??C1 sRGB ??¨Ś gAMA ĄŔ? ¨ša pHYs ? ??oĄ§d GIDATx^¨Ş¨šLĄąĄÂeĄÂY?a?("Bh?_¨°???ĄéĄě?q5k?*:t0A-o??٤]VkJĄéM??f?ĄŔ8\k2¨ŞllĄę1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
Ńň \ĐKc@s‰dZdZddkZddklZdefd„ƒYZeƒZdeid„Z d efd „ƒYZ d e fd „ƒYZ dS( sÚA file interface for handling local and remote data files. The goal of datasource is to abstract some of the file system operations when dealing with data files so the researcher doesn't have to know all the low-level details. Through datasource, a researcher can obtain and use a file with one function call, regardless of location of the file. DataSource is meant to augment standard python libraries, not replace them. It should work seemlessly with standard file IO operations and the os module. DataSource files can originate locally or remotely: - local files : '/home/guido/src/local/data.txt' - URLs (http, ftp, ...) : 'http://www.scipy.org/not/real/data.txt' DataSource files can also be compressed or uncompressed. Currently only gzip and bz2 are supported. Example:: >>> # Create a DataSource, use os.curdir (default) for local storage. >>> ds = datasource.DataSource() >>> >>> # Open a remote file. >>> # DataSource downloads the file, stores it locally in: >>> # './www.google.com/index.html' >>> # opens the file and returns a file object. >>> fp = ds.open('http://www.google.com/index.html') >>> >>> # Use the file as you normally would >>> fp.read() >>> fp.close() srestructuredtext eni˙˙˙˙N(trmtreet _FileOpenerscBs2eZdZd„Zd„Zd„Zd„ZRS(sŢ Container for different methods to open (un-)compressed files. `_FileOpeners` contains a dictionary that holds one method for each supported file format. Attribute lookup is implemented in such a way that an instance of `_FileOpeners` itself can be indexed with the keys of that dictionary. Currently uncompressed files as well as files compressed with ``gzip`` or ``bz2`` compression are supported. Notes ----- `_file_openers`, an instance of `_FileOpeners`, is made available for use in the `_datasource` module. Examples -------- >>> np.lib._datasource._file_openers.keys() [None, '.bz2', '.gz'] >>> np.lib._datasource._file_openers['.gz'] is gzip.open True cCst|_htd6|_dS(N(tFalset_loadedtopentNonet _file_openers(tself((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt__init__Ds c Csˆ|iodSy ddk}|i|id>> repos = DataSource() >>> repos.exists('www.google.com/index.html') False >>> repos.exists('http://www.google.com/index.html') True Temporary directories are deleted when the DataSource is deleted. Examples -------- :: >>> ds = DataSource('/home/guido') >>> urlname = 'http://www.google.com/index.html' >>> gfile = ds.open('http://www.google.com/index.html') # remote file >>> ds.abspath(urlname) '/home/guido/www.google.com/site/index.html' >>> ds = DataSource(None) # use with temporary file >>> ds.open('/home/guido/foobar.txt') >>> ds.abspath('/home/guido/foobar.txt') '/tmp/tmpy4pgsP/home/guido/foobar.txt' cCsQ|o"tii|ƒ|_t|_n%ddk}|iƒ|_t|_dS(s2Create a DataSource with a local path at destpath.i˙˙˙˙N( tosRtabspatht _destpathRt _istmpdestttempfiletmkdtempR (RRR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRĂs   cCs|iot|iƒndS(N(RRR(R((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt__del__Ís cCs(tii|ƒ\}}|tiƒjS(sMTest if the filename is a zip file by looking at the file extension. (RRtsplitextRR(Rtfilenametfnametext((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt_iszipŇscCs-d}x |D]}||jotSq WtS(s4Test if the given mode will open a file for writing.twt+(R'R((R R(RRt _writemodestc((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt _iswritemodeŘs   cCs/|i|ƒotii|ƒS|dfSdS(sxSplit zip extension from filename and return filename. *Returns*: base, zip_ext : {tuple} N(R&RRR"R(RR#((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt _splitzipextâscCsT|g}|i|ƒp7x4tiƒD]"}|o|i||ƒq&q&Wn|S(s9Return a tuple containing compressed filename variations.(R&RRtappend(RR#tnamestzipext((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt_possible_namesďs  c Cs?ddkl}||ƒ\}}}}}}t|o|ƒS(s=Test if path is a net location. Tests the scheme and netloc.i˙˙˙˙(turlparse(R1tbool( RRR1tschemetnetloctupathtuparamstuquerytufrag((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt_isurlřscCs ddkl}l}|i|ƒ}tiitii|ƒƒptitii|ƒƒn|i |ƒoVy,||ƒ}t |dƒi |i ƒƒWq|j o|d|ƒ‚qXnVy/t |dƒ}t |dƒi |i ƒƒWn#t j ot d|ƒ‚nX|S(shCache the file specified by path. Creates a copy of the file in the datasource cache. i˙˙˙˙(turlopentURLErrorR'sURL not found: %sRsFile not found: %s(turllib2R:R;RRRtexiststdirnametmakedirsR9tfiletwritetreadtIOError(RRR:R;R5t openedurltfp((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt_caches    cCsˇ|i|ƒp/|i|ƒ}||i|i|ƒƒ7}n,|i|i|ƒƒ}||i|ƒ}xF|D]>}|i|ƒo(|i|ƒo|i|ƒ}n|SqqWdS(sSearches for ``path`` and returns full path if found. If path is an URL, _findfile will cache a local copy and return the path to the cached file. If path is a local file, _findfile will return a path to that local file. The search will include possible compressed versions of the file and return the first occurence found. N(R9R0RR=RFR(RRtfilelisttname((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt _findfile's  c Cs›ddkl}|i|idƒ}t|ƒdjo|d}n||ƒ\}}}}}} |i|ƒ}|i|ƒ}tii|i||ƒS(sF Return absolute path of file in the DataSource directory. If `path` is an URL, then `abspath` will return either the location the file exists locally or the location it would exist when opened using the `open` method. Parameters ---------- path : str Can be a local file or a remote URL. Returns ------- out : str Complete path, including the `DataSource` destination directory. Notes ----- The functionality is based on `os.path.abspath`. i˙˙˙˙(R1ii(R1tsplitRtlent_sanitize_relative_pathRRtjoin( RRR1t splitpathR3R4R5R6R7R8((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRGs cCs…d}tii|ƒ}xf||joX|}|itiƒidƒ}|itiƒidƒ}tii|ƒ\}}qW|S(svReturn a sanitised relative path for which os.path.abspath(os.path.join(base, path)).startswith(base) t/s..N(RRRtnormpathtlstriptseptpardirt splitdrive(RRtlasttdrive((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRLrs cCs›ddkl}l}tii|ƒotS|i|ƒ}tii|ƒotS|i|ƒo2y||ƒ}~tSWq—|j ot SXnt S(s( Test if path exists. Test if `path` exists as (and in this order): - a local file. - a remote URL that has been downloaded and stored locally in the `DataSource` directory. - a remote URL that has not been downloaded, but is valid and accessible. Parameters ---------- path : str Can be a local file or a remote URL. Returns ------- out : bool True if `path` exists. Notes ----- When `path` is an URL, `exists` will return True if it's either stored locally in the `DataSource` directory, or is a valid remote URL. `DataSource` does not discriminate between the two, the file is accessible if it exists in either location. i˙˙˙˙(R:R;( R<R:R;RRR=R RR9R(RRR:R;R5tnetfile((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR=€s  RcCsĽ|i|ƒo |i|ƒotdƒ‚n|i|ƒ}|oK|i|ƒ\}}|djo|iddƒnt||d|ƒStd|ƒ‚dS(sR Open and return file-like object. If `path` is an URL, it will be downloaded, stored in the `DataSource` directory and opened from there. Parameters ---------- path : str Local file path or URL to open. mode : {'r', 'w', 'a'}, optional Mode to open `path`. Mode 'r' for reading, 'w' for writing, 'a' to append. Available modes depend on the type of object specified by `path`. Default is 'r'. Returns ------- out : file object File object. sURLs are not writeableR R(tRs %s not found.N(R9R+t ValueErrorRIR,treplaceRRC(RRRtfoundt_fnameR%((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR´s  (RRRRtcurdirRR!R&R+R,R0R9RFRIRRLR=R(((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR’s/    +  4t RepositorycBs_eZdZeid„Zd„Zd„Zd„Zd„Z d„Z dd„Z d „Z RS( sý Repository(baseurl, destpath='.') A data repository where multiple DataSource's share a base URL/directory. `Repository` extends `DataSource` by prepending a base URL (or directory) to all the files it handles. Use `Repository` when you will be working with multiple files from one base URL. Initialize `Repository` with the base URL, then refer to each file by its filename only. Parameters ---------- baseurl : str Path to the local directory or remote location that contains the data files. destpath : str or None, optional Path to the directory where the source file gets downloaded to for use. If `destpath` is None, a temporary directory will be created. The default path is the current directory. Examples -------- To analyze all files in the repository, do something like this (note: this is not self-contained code):: >>> repos = np.lib._datasource.Repository('/home/user/data/dir/') >>> for filename in filelist: ... fp = repos.open(filename) ... fp.analyze() ... fp.close() Similarly you could use a URL for a repository:: >>> repos = np.lib._datasource.Repository('http://www.xyz.edu/data') cCs ti|d|ƒ||_dS(s>Create a Repository with a shared url or directory of baseurl.RN(RRt_baseurl(RtbaseurlR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRscCsti|ƒdS(N(RR!(R((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR! scCsN|i|idƒ}t|ƒdjotii|i|ƒ}n|}|S(s>Return complete path for path. Prepends baseurl if necessary.ii(RJR_RKRRRM(RRRNtresult((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt _fullpath s cCsti||i|ƒƒS(s8Extend DataSource method to prepend baseurl to ``path``.(RRIRb(RR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRIscCsti||i|ƒƒS(s_ Return absolute path of file in the Repository directory. If `path` is an URL, then `abspath` will return either the location the file exists locally or the location it would exist when opened using the `open` method. Parameters ---------- path : str Can be a local file or a remote URL. This may, but does not have to, include the `baseurl` with which the `Repository` was initialized. Returns ------- out : str Complete path, including the `DataSource` destination directory. (RRRb(RR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRscCsti||i|ƒƒS(sČ Test if path exists prepending Repository base URL to path. Test if `path` exists as (and in this order): - a local file. - a remote URL that has been downloaded and stored locally in the `DataSource` directory. - a remote URL that has not been downloaded, but is valid and accessible. Parameters ---------- path : str Can be a local file or a remote URL. This may, but does not have to, include the `baseurl` with which the `Repository` was initialized. Returns ------- out : bool True if `path` exists. Notes ----- When `path` is an URL, `exists` will return True if it's either stored locally in the `DataSource` directory, or is a valid remote URL. `DataSource` does not discriminate between the two, the file is accessible if it exists in either location. (RR=Rb(RR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR=0sRcCsti||i|ƒ|ƒS(sŢ Open and return file-like object prepending Repository base URL. If `path` is an URL, it will be downloaded, stored in the DataSource directory and opened from there. Parameters ---------- path : str Local file path or URL to open. This may, but does not have to, include the `baseurl` with which the `Repository` was initialized. mode : {'r', 'w', 'a'}, optional Mode to open `path`. Mode 'r' for reading, 'w' for writing, 'a' to append. Available modes depend on the type of object specified by `path`. Default is 'r'. Returns ------- out : file object File object. (RRRb(RRR((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRQscCs4|i|iƒo td‚nti|iƒSdS(s  List files in the source Repository. Returns ------- files : list of str List of file names (not containing a directory part). Notes ----- Does not currently work for remote repositories. s-Directory listing of URLs, not supported yet.N(R9R_tNotImplementedErrorRtlistdir(R((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyRdjs ( RRRRR]RR!RbRIRR=RRd(((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyR^ßs$    ! ( Rt __docformat__RtshutilRtobjectRRR]RRR^(((s;/usr/lib64/python2.6/site-packages/numpy/lib/_datasource.pyt!s ? $˙N