neulab/docprompting-conala huggingface dataset:
pickle.load(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)  
Read the pickled representation of an object from the open file object file and return the reconstituted object hierarchy specified therein. This is equivalent to Unpickler(file).load(). The protocol version of the pickle is detected automatically, so no protocol argument is needed. Bytes past the pickled representation of the object are ignored. Arguments file, fix_imports, encoding, errors, strict and buffers have the same meaning as in the Unpickler constructor.  Changed in version 3.8: The buffers argument was added.
pickle.loads(data, /, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)  
Return the reconstituted object hierarchy of the pickled representation data of an object. data must be a bytes-like object. The protocol version of the pickle is detected automatically, so no protocol argument is needed. Bytes past the pickled representation of the object are ignored. Arguments file, fix_imports, encoding, errors, strict and buffers have the same meaning as in the Unpickler constructor.  Changed in version 3.8: The buffers argument was added.
class pickle.PickleBuffer(buffer)  
A wrapper for a buffer representing picklable data. buffer must be a buffer-providing object, such as a bytes-like object or a N-dimensional array. PickleBuffer is itself a buffer provider, therefore it is possible to pass it to other APIs expecting a buffer-providing object, such as memoryview. PickleBuffer objects can only be serialized using pickle protocol 5 or higher. They are eligible for out-of-band serialization.  New in version 3.8.   
raw()  
Return a memoryview of the memory area underlying this buffer. The returned object is a one-dimensional, C-contiguous memoryview with format B (unsigned bytes). BufferError is raised if the buffer is neither C- nor Fortran-contiguous. 
  
release()  
Release the underlying buffer exposed by the PickleBuffer object.
raw()  
Return a memoryview of the memory area underlying this buffer. The returned object is a one-dimensional, C-contiguous memoryview with format B (unsigned bytes). BufferError is raised if the buffer is neither C- nor Fortran-contiguous.
exception pickle.PickleError  
Common base class for the other pickling exceptions. It inherits Exception.
dispatch_table  
A pickler object’s dispatch table is a registry of reduction functions of the kind which can be declared using copyreg.pickle(). It is a mapping whose keys are classes and whose values are reduction functions. A reduction function takes a single argument of the associated class and should conform to the same interface as a __reduce__() method. By default, a pickler object will not have a dispatch_table attribute, and it will instead use the global dispatch table managed by the copyreg module. However, to customize the pickling for a specific pickler object one can set the dispatch_table attribute to a dict-like object. Alternatively, if a subclass of Pickler has a dispatch_table attribute then this will be used as the default dispatch table for instances of that class. See Dispatch Tables for usage examples.  New in version 3.3.
dump(obj)  
Write the pickled representation of obj to the open file object given in the constructor.
fast  
Deprecated. Enable fast mode if set to a true value. The fast mode disables the usage of memo, therefore speeding the pickling process by not generating superfluous PUT opcodes. It should not be used with self-referential objects, doing otherwise will cause Pickler to recurse infinitely. Use pickletools.optimize() if you need more compact pickles.
persistent_id(obj)  
Do nothing by default. This exists so a subclass can override it. If persistent_id() returns None, obj is pickled as usual. Any other value causes Pickler to emit the returned value as a persistent ID for obj. The meaning of this persistent ID should be defined by Unpickler.persistent_load(). Note that the value returned by persistent_id() cannot itself have a persistent ID. See Persistence of External Objects for details and examples of uses.
reducer_override(self, obj)  
Special reducer that can be defined in Pickler subclasses. This method has priority over any reducer in the dispatch_table. It should conform to the same interface as a __reduce__() method, and can optionally return NotImplemented to fallback on dispatch_table-registered reducers to pickle obj. For a detailed example, see Custom Reduction for Types, Functions, and Other Objects.  New in version 3.8.
exception pickle.PicklingError  
Error raised when an unpicklable object is encountered by Pickler. It inherits PickleError. Refer to What can be pickled and unpickled? to learn what kinds of objects can be pickled.
class pickle.Unpickler(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)  
This takes a binary file for reading a pickle data stream. The protocol version of the pickle is detected automatically, so no protocol argument is needed. The argument file must have three methods, a read() method that takes an integer argument, a readinto() method that takes a buffer argument and a readline() method that requires no arguments, as in the io.BufferedIOBase interface. Thus file can be an on-disk file opened for binary reading, an io.BytesIO object, or any other custom object that meets this interface. The optional arguments fix_imports, encoding and errors are used to control compatibility support for pickle stream generated by Python 2. If fix_imports is true, pickle will try to map the old Python 2 names to the new names used in Python 3. The encoding and errors tell pickle how to decode 8-bit string instances pickled by Python 2; these default to ‘ASCII’ and ‘strict’, respectively. The encoding can be ‘bytes’ to read these 8-bit string instances as bytes objects. Using encoding='latin1' is required for unpickling NumPy arrays and instances of datetime, date and time pickled by Python 2. If buffers is None (the default), then all data necessary for deserialization must be contained in the pickle stream. This means that the buffer_callback argument was None when a Pickler was instantiated (or when dump() or dumps() was called). If buffers is not None, it should be an iterable of buffer-enabled objects that is consumed each time the pickle stream references an out-of-band buffer view. Such buffers have been given in order to the buffer_callback of a Pickler object.  Changed in version 3.8: The buffers argument was added.   
load()  
Read the pickled representation of an object from the open file object given in the constructor, and return the reconstituted object hierarchy specified therein. Bytes past the pickled representation of the object are ignored. 
  
persistent_load(pid)  
Raise an UnpicklingError by default. If defined, persistent_load() should return the object specified by the persistent ID pid. If an invalid persistent ID is encountered, an UnpicklingError should be raised. See Persistence of External Objects for details and examples of uses. 
  
find_class(module, name)  
Import module if necessary and return the object called name from it, where the module and name arguments are str objects. Note, unlike its name suggests, find_class() is also used for finding functions. Subclasses may override this to gain control over what type of objects and how they can be loaded, potentially reducing security risks. Refer to Restricting Globals for details. Raises an auditing event pickle.find_class with arguments module, name.
find_class(module, name)  
Import module if necessary and return the object called name from it, where the module and name arguments are str objects. Note, unlike its name suggests, find_class() is also used for finding functions. Subclasses may override this to gain control over what type of objects and how they can be loaded, potentially reducing security risks. Refer to Restricting Globals for details. Raises an auditing event pickle.find_class with arguments module, name.
load()  
Read the pickled representation of an object from the open file object given in the constructor, and return the reconstituted object hierarchy specified therein. Bytes past the pickled representation of the object are ignored.
persistent_load(pid)  
Raise an UnpicklingError by default. If defined, persistent_load() should return the object specified by the persistent ID pid. If an invalid persistent ID is encountered, an UnpicklingError should be raised. See Persistence of External Objects for details and examples of uses.
exception pickle.UnpicklingError  
Error raised when there is a problem unpickling an object, such as a data corruption or a security violation. It inherits PickleError. Note that other exceptions may also be raised during unpickling, including (but not necessarily limited to) AttributeError, EOFError, ImportError, and IndexError.
pickletools — Tools for pickle developers Source code: Lib/pickletools.py This module contains various constants relating to the intimate details of the pickle module, some lengthy comments about the implementation, and a few useful functions for analyzing pickled data. The contents of this module are useful for Python core developers who are working on the pickle; ordinary users of the pickle module probably won’t find the pickletools module relevant. Command line usage  New in version 3.2.  When invoked from the command line, python -m pickletools will disassemble the contents of one or more pickle files. Note that if you want to see the Python object stored in the pickle rather than the details of pickle format, you may want to use -m pickle instead. However, when the pickle file that you want to examine comes from an untrusted source, -m pickletools is a safer option because it does not execute pickle bytecode. For example, with a tuple (1, 2) pickled in file x.pickle: $ python -m pickle x.pickle
(1, 2)

$ python -m pickletools x.pickle
    0: \x80 PROTO      3
    2: K    BININT1    1
    4: K    BININT1    2
    6: \x86 TUPLE2
    7: q    BINPUT     0
    9: .    STOP
highest protocol among opcodes = 2
 Command line options  
-a, --annotate  
Annotate each line with a short opcode description. 
  
-o, --output=<file>  
Name of a file where the output should be written. 
  
-l, --indentlevel=<num>  
The number of blanks by which to indent a new MARK level. 
  
-m, --memo  
When multiple objects are disassembled, preserve memo between disassemblies. 
  
-p, --preamble=<preamble>  
When more than one pickle file are specified, print given preamble before each disassembly. 
 Programmatic Interface  
pickletools.dis(pickle, out=None, memo=None, indentlevel=4, annotate=0)  
Outputs a symbolic disassembly of the pickle to the file-like object out, defaulting to sys.stdout. pickle can be a string or a file-like object. memo can be a Python dictionary that will be used as the pickle’s memo; it can be used to perform disassemblies across multiple pickles created by the same pickler. Successive levels, indicated by MARK opcodes in the stream, are indented by indentlevel spaces. If a nonzero value is given to annotate, each opcode in the output is annotated with a short description. The value of annotate is used as a hint for the column where annotation should start.  New in version 3.2: The annotate argument.  
  
pickletools.genops(pickle)  
Provides an iterator over all of the opcodes in a pickle, returning a sequence of (opcode, arg, pos) triples. opcode is an instance of an OpcodeInfo class; arg is the decoded value, as a Python object, of the opcode’s argument; pos is the position at which this opcode is located. pickle can be a string or a file-like object. 
  
pickletools.optimize(picklestring)  
Returns a new equivalent pickle string after eliminating unused PUT opcodes. The optimized pickle is shorter, takes less transmission time, requires less storage space, and unpickles more efficiently.
pickletools.dis(pickle, out=None, memo=None, indentlevel=4, annotate=0)  
Outputs a symbolic disassembly of the pickle to the file-like object out, defaulting to sys.stdout. pickle can be a string or a file-like object. memo can be a Python dictionary that will be used as the pickle’s memo; it can be used to perform disassemblies across multiple pickles created by the same pickler. Successive levels, indicated by MARK opcodes in the stream, are indented by indentlevel spaces. If a nonzero value is given to annotate, each opcode in the output is annotated with a short description. The value of annotate is used as a hint for the column where annotation should start.  New in version 3.2: The annotate argument.
pickletools.genops(pickle)  
Provides an iterator over all of the opcodes in a pickle, returning a sequence of (opcode, arg, pos) triples. opcode is an instance of an OpcodeInfo class; arg is the decoded value, as a Python object, of the opcode’s argument; pos is the position at which this opcode is located. pickle can be a string or a file-like object.
pickletools.optimize(picklestring)  
Returns a new equivalent pickle string after eliminating unused PUT opcodes. The optimized pickle is shorter, takes less transmission time, requires less storage space, and unpickles more efficiently.
pipes — Interface to shell pipelines Source code: Lib/pipes.py The pipes module defines a class to abstract the concept of a pipeline — a sequence of converters from one file to another. Because the module uses /bin/sh command lines, a POSIX or compatible shell for os.system() and os.popen() is required. The pipes module defines the following class:  
class pipes.Template  
An abstraction of a pipeline. 
 Example: >>> import pipes
>>> t = pipes.Template()
>>> t.append('tr a-z A-Z', '--')
>>> f = t.open('pipefile', 'w')
>>> f.write('hello world')
>>> f.close()
>>> open('pipefile').read()
'HELLO WORLD'
 Template Objects Template objects following methods:  
Template.reset()  
Restore a pipeline template to its initial state. 
  
Template.clone()  
Return a new, equivalent, pipeline template. 
  
Template.debug(flag)  
If flag is true, turn debugging on. Otherwise, turn debugging off. When debugging is on, commands to be executed are printed, and the shell is given set -x command to be more verbose. 
  
Template.append(cmd, kind)  
Append a new action at the end. The cmd variable must be a valid bourne shell command. The kind variable consists of two letters. The first letter can be either of '-' (which means the command reads its standard input), 'f' (which means the commands reads a given file on the command line) or '.' (which means the commands reads no input, and hence must be first.) Similarly, the second letter can be either of '-' (which means the command writes to standard output), 'f' (which means the command writes a file on the command line) or '.' (which means the command does not write anything, and hence must be last.) 
  
Template.prepend(cmd, kind)  
Add a new action at the beginning. See append() for explanations of the arguments. 
  
Template.open(file, mode)  
Return a file-like object, open to file, but read from or written to by the pipeline. Note that only one of 'r', 'w' may be given. 
  
Template.copy(infile, outfile)  
Copy infile to outfile through the pipe.
Template.append(cmd, kind)  
Append a new action at the end. The cmd variable must be a valid bourne shell command. The kind variable consists of two letters. The first letter can be either of '-' (which means the command reads its standard input), 'f' (which means the commands reads a given file on the command line) or '.' (which means the commands reads no input, and hence must be first.) Similarly, the second letter can be either of '-' (which means the command writes to standard output), 'f' (which means the command writes a file on the command line) or '.' (which means the command does not write anything, and hence must be last.)
Template.copy(infile, outfile)  
Copy infile to outfile through the pipe.
Template.debug(flag)  
If flag is true, turn debugging on. Otherwise, turn debugging off. When debugging is on, commands to be executed are printed, and the shell is given set -x command to be more verbose.
Template.open(file, mode)  
Return a file-like object, open to file, but read from or written to by the pipeline. Note that only one of 'r', 'w' may be given.
Template.prepend(cmd, kind)  
Add a new action at the beginning. See append() for explanations of the arguments.
pkgutil.extend_path(path, name)  
Extend the search path for the modules which comprise a package. Intended use is to place the following code in a package’s __init__.py: from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
 This will add to the package’s __path__ all subdirectories of directories on sys.path named after the package. This is useful if one wants to distribute different parts of a single logical package as multiple directories. It also looks for *.pkg files beginning where * matches the name argument. This feature is similar to *.pth files (see the site module for more information), except that it doesn’t special-case lines starting with import. A *.pkg file is trusted at face value: apart from checking for duplicates, all entries found in a *.pkg file are added to the path, regardless of whether they exist on the filesystem. (This is a feature.) If the input path is not a list (as is the case for frozen packages) it is returned unchanged. The input path is not modified; an extended copy is returned. Items are only appended to the copy at the end. It is assumed that sys.path is a sequence. Items of sys.path that are not strings referring to existing directories are ignored. Unicode items on sys.path that cause errors when used as filenames may cause this function to raise an exception (in line with os.path.isdir() behavior).
pkgutil.find_loader(fullname)  
Retrieve a module loader for the given fullname. This is a backwards compatibility wrapper around importlib.util.find_spec() that converts most failures to ImportError and only returns the loader rather than the full ModuleSpec.  Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.   Changed in version 3.4: Updated to be based on PEP 451
pkgutil.get_data(package, resource)  
Get a resource from a package. This is a wrapper for the loader get_data API. The package argument should be the name of a package, in standard module format (foo.bar). The resource argument should be in the form of a relative filename, using / as the path separator. The parent directory name .. is not allowed, and nor is a rooted name (starting with a /). The function returns a binary string that is the contents of the specified resource. For packages located in the filesystem, which have already been imported, this is the rough equivalent of: d = os.path.dirname(sys.modules[package].__file__)
data = open(os.path.join(d, resource), 'rb').read()
 If the package cannot be located or loaded, or it uses a loader which does not support get_data, then None is returned. In particular, the loader for namespace packages does not support get_data.
pkgutil.get_importer(path_item)  
Retrieve a finder for the given path_item. The returned finder is cached in sys.path_importer_cache if it was newly created by a path hook. The cache (or part of it) can be cleared manually if a rescan of sys.path_hooks is necessary.  Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.
pkgutil.get_loader(module_or_name)  
Get a loader object for module_or_name. If the module or package is accessible via the normal import mechanism, a wrapper around the relevant part of that machinery is returned. Returns None if the module cannot be found or imported. If the named module is not already imported, its containing package (if any) is imported, in order to establish the package __path__.  Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.   Changed in version 3.4: Updated to be based on PEP 451
class pkgutil.ImpImporter(dirname=None)  
PEP 302 Finder that wraps Python’s “classic” import algorithm. If dirname is a string, a PEP 302 finder is created that searches that directory. If dirname is None, a PEP 302 finder is created that searches the current sys.path, plus any modules that are frozen or built-in. Note that ImpImporter does not currently support being used by placement on sys.meta_path.  Deprecated since version 3.3: This emulation is no longer needed, as the standard import mechanism is now fully PEP 302 compliant and available in importlib.
class pkgutil.ImpLoader(fullname, file, filename, etc)  
Loader that wraps Python’s “classic” import algorithm.  Deprecated since version 3.3: This emulation is no longer needed, as the standard import mechanism is now fully PEP 302 compliant and available in importlib.
pkgutil.iter_importers(fullname='')  
Yield finder objects for the given module name. If fullname contains a ‘.’, the finders will be for the package containing fullname, otherwise they will be all registered top level finders (i.e. those on both sys.meta_path and sys.path_hooks). If the named module is in a package, that package is imported as a side effect of invoking this function. If no module name is specified, all top level finders are produced.  Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.
pkgutil.iter_modules(path=None, prefix='')  
Yields ModuleInfo for all submodules on path, or, if path is None, all top-level modules on sys.path. path should be either None or a list of paths to look for modules in. prefix is a string to output on the front of every module name on output.  Note Only works for a finder which defines an iter_modules() method. This interface is non-standard, so the module also provides implementations for importlib.machinery.FileFinder and zipimport.zipimporter.   Changed in version 3.3: Updated to be based directly on importlib rather than relying on the package internal PEP 302 import emulation.
class pkgutil.ModuleInfo(module_finder, name, ispkg)  
A namedtuple that holds a brief summary of a module’s info.  New in version 3.6.
pkgutil.resolve_name(name)  
Resolve a name to an object. This functionality is used in numerous places in the standard library (see bpo-12915) - and equivalent functionality is also in widely used third-party packages such as setuptools, Django and Pyramid. It is expected that name will be a string in one of the following formats, where W is shorthand for a valid Python identifier and dot stands for a literal period in these pseudo-regexes:  W(.W)* W(.W)*:(W(.W)*)?  The first form is intended for backward compatibility only. It assumes that some part of the dotted name is a package, and the rest is an object somewhere within that package, possibly nested inside other objects. Because the place where the package stops and the object hierarchy starts can’t be inferred by inspection, repeated attempts to import must be done with this form. In the second form, the caller makes the division point clear through the provision of a single colon: the dotted name to the left of the colon is a package to be imported, and the dotted name to the right is the object hierarchy within that package. Only one import is needed in this form. If it ends with the colon, then a module object is returned. The function will return an object (which might be a module), or raise one of the following exceptions: ValueError – if name isn’t in a recognised format. ImportError – if an import failed when it shouldn’t have. AttributeError – If a failure occurred when traversing the object hierarchy within the imported package to get to the desired object.  New in version 3.9.