/usr/local/lib/python3.6/site-packages/dill/__pycache__
NameSizeModeActions
detect.cpython-36.pyc86530644editdlrm
info.cpython-36.pyc104980644editdlrm
objtypes.cpython-36.pyc5050644editdlrm
pointers.cpython-36.pyc34060644editdlrm
settings.cpython-36.pyc3970644editdlrm
source.cpython-36.pyc267190644editdlrm
temp.cpython-36.pyc73020644editdlrm
_dill.cpython-36.pyc423680644editdlrm
_objects.cpython-36.pyc141340644editdlrm
__diff.cpython-36.pyc58540644editdlrm
__init__.cpython-36.pyc35310644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/dill/__pycache__/temp.cpython-36.pyc (7302B)
3 8%Eg2 @sdZddddddddd g Zd d lZd d lmZejddd ZddZddZddZ ddZ ddZ ddZ ddZ ddZddZ[d S)zb Methods for serialized objects (or source code) stored in temporary files and file-like objects. dump_sourcedump dumpIO_sourcedumpIO load_sourceload loadIO_sourceloadIOcaptureN)PY3stdoutc csbddl}trddlm}n ddlm}t||}t|||zt||VWdt|||XdS)zbuilds a context that temporarily replaces the given stream name >>> with capture('stdout') as out: ... print ("foo!") ... >>> print (out.getvalue()) foo! r N)StringIO)sysr iorgetattrsetattr)streamrrorigr3/usr/local/lib/python3.6/site-packages/dill/temp.pyr s   cCsddl}|j|dS)Nr )codecslatin_1_encode)xrrrrb/src Ks|jdd}|jdd}t|d|}t|fd|i|j}|s|jjd j}|ddkrx|jd}td ||d }i}t||t d ||} | S) aCload an object that was stored with dill.temp.dump_source file: filehandle alias: string name of stored object mode: mode to open the file, one of: {'r', 'rb'} >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, alias='_f') >>> _f = dill.temp.load_source(pyfile) >>> _f(4) 16 aliasNmodernamer r z#NAME:zunknown name for code: %sz%sr) popropenreadstrip splitlinessplitIOErrorexeceval) filekwdsrrfnamesourcetagstublocal_rrrr3s       cKsddlm}m}ddl}|jdd|jdd}t|p>||}d|}|jfdd i|}|jtdj |||d |g|j |S) aMwrite object source to a NamedTemporaryFile (instead of dill.dump) Loads with "import" or "dill.temp.load_source". Returns the filehandle. >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, alias='_f') >>> _f = dill.temp.load_source(pyfile) >>> _f(4) 16 >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, dir='.') >>> modulename = os.path.basename(pyfile.name).split('.py')[0] >>> exec('from %s import f as _f' % modulename) >>> _f(4) 16 Optional kwds: If 'alias' is specified, the object will be renamed to the given string. If 'prefix' is specified, the file name will begin with that prefix, otherwise a default prefix is used. If 'dir' is specified, the file will be created in that directory, otherwise a default directory is used. If 'text' is specified and true, the file is opened in text mode. Else (the default) the file is opened in binary mode. On some operating systems, this makes no difference. NOTE: Keep the return value for as long as you want your file to exist ! r ) importablegetnamer Nsuffixrz #NAME: %s z.py)r) r,r1r2tempfiler strNamedTemporaryFilewriterjoinflush)objectr*r1r2r5rrr)rrrrOs    cKs:ddl}|jdd}t|d|}|jt|fd|i|S)zload an object that was stored with dill.temp.dump file: filehandle mode: mode to open the file, one of: {'r', 'rb'} >>> dumpfile = dill.temp.dump([1, 2, 3, 4, 5]) >>> dill.temp.load(dumpfile) [1, 2, 3, 4, 5] r Nrrbr)dillr rrr!)r)r*picklerrrrrr{s   cKs4ddl}ddl}|jf|}|j|||j|S)aEdill.dump of object to a NamedTemporaryFile. Loads with "dill.temp.load". Returns the filehandle. >>> dumpfile = dill.temp.dump([1, 2, 3, 4, 5]) >>> dill.temp.load(dumpfile) [1, 2, 3, 4, 5] Optional kwds: If 'suffix' is specified, the file name will end with that suffix, otherwise there will be no suffix. If 'prefix' is specified, the file name will begin with that prefix, otherwise a default prefix is used. If 'dir' is specified, the file will be created in that directory, otherwise a default directory is used. If 'text' is specified and true, the file is opened in text mode. Else (the default) the file is opened in binary mode. On some operating systems, this makes no difference. NOTE: Keep the return value for as long as you want your file to exist ! r N)r=r5r7rr:)r;r*r>r5r)rrrrs   cKsNddl}trddlm}n ddlm}t|d|}||kr@|}|j||S)zload an object that was stored with dill.temp.dumpIO buffer: buffer object >>> dumpfile = dill.temp.dumpIO([1, 2, 3, 4, 5]) >>> dill.temp.loadIO(dumpfile) [1, 2, 3, 4, 5] r N)BytesIO)rgetvalue)r=r rr?rrr)bufferr*r>rvaluerrrrs   cKsDddl}trddlm}n ddlm}|}|j|||j|S)zdill.dump of object to a buffer. Loads with "dill.temp.loadIO". Returns the buffer object. >>> dumpfile = dill.temp.dumpIO([1, 2, 3, 4, 5]) >>> dill.temp.loadIO(dumpfile) [1, 2, 3, 4, 5] r N)r?)r)r=r rr?rrr:)r;r*r>rr)rrrrs  cKs|jdd}t|d|}||kr&|}tr2|j}|sv|jjd j}|ddkrn|jd}td||d }i}t||t d||}|S) aload an object that was stored with dill.temp.dumpIO_source buffer: buffer object alias: string name of stored object >>> f = lambda x:x**2 >>> pyfile = dill.temp.dumpIO_source(f, alias='_f') >>> _f = dill.temp.loadIO_source(pyfile) >>> _f(4) 16 rNr@r r z#NAME:zunknown name for code: %sz%srr) r rr decoder#r$r%r&r'r()rAr*rr,r-r.r/r0rrrrs      cKsddlm}m}tr"ddlm}n ddlm}|jdd}t|pH||}d|}|}|j t dj |||d |g|j |S) apwrite object source to a buffer (instead of dill.dump) Loads by with dill.temp.loadIO_source. Returns the buffer object. >>> f = lambda x:x**2 >>> pyfile = dill.temp.dumpIO_source(f, alias='_f') >>> _f = dill.temp.loadIO_source(pyfile) >>> _f(4) 16 Optional kwds: If 'alias' is specified, the object will be renamed to the given string. r )r1r2r )r?)rrr4z #NAME: %s )r) r,r1r2r rr?rr r6r8rr9r:)r;r*r1r2rrrr)rrrrs    )r )__doc____all__ contextlibZ_dillr contextmanagerr rrrrrrrrrrrrr s"  ,