neulab/docprompting-conala huggingface dataset:
importlib.resources.read_binary(package, resource)  
Read and return the contents of the resource within package as bytes. package is either a name or a module object which conforms to the Package requirements. resource is the name of the resource to open within package; it may not contain path separators and it may not have sub-resources (i.e. it cannot be a directory). This function returns the contents of the resource as bytes.
importlib.resources.read_text(package, resource, encoding='utf-8', errors='strict')  
Read and return the contents of resource within package as a str. By default, the contents are read as strict UTF-8. package is either a name or a module object which conforms to the Package requirements. resource is the name of the resource to open within package; it may not contain path separators and it may not have sub-resources (i.e. it cannot be a directory). encoding and errors have the same meaning as with built-in open(). This function returns the contents of the resource as str.
importlib.resources.Resource  
This type describes the resource names passed into the various functions in this package. This is defined as Union[str, os.PathLike].
importlib.util.cache_from_source(path, debug_override=None, *, optimization=None)  
Return the PEP 3147/PEP 488 path to the byte-compiled file associated with the source path. For example, if path is /foo/bar/baz.py the return value would be /foo/bar/__pycache__/baz.cpython-32.pyc for Python 3.2. The cpython-32 string comes from the current magic tag (see get_tag(); if sys.implementation.cache_tag is not defined then NotImplementedError will be raised). The optimization parameter is used to specify the optimization level of the bytecode file. An empty string represents no optimization, so /foo/bar/baz.py with an optimization of '' will result in a bytecode path of /foo/bar/__pycache__/baz.cpython-32.pyc. None causes the interpreter’s optimization level to be used. Any other value’s string representation is used, so /foo/bar/baz.py with an optimization of 2 will lead to the bytecode path of /foo/bar/__pycache__/baz.cpython-32.opt-2.pyc. The string representation of optimization can only be alphanumeric, else ValueError is raised. The debug_override parameter is deprecated and can be used to override the system’s value for __debug__. A True value is the equivalent of setting optimization to the empty string. A False value is the same as setting optimization to 1. If both debug_override an optimization are not None then TypeError is raised.  New in version 3.4.   Changed in version 3.5: The optimization parameter was added and the debug_override parameter was deprecated.   Changed in version 3.6: Accepts a path-like object.
importlib.util.decode_source(source_bytes)  
Decode the given bytes representing source code and return it as a string with universal newlines (as required by importlib.abc.InspectLoader.get_source()).  New in version 3.4.
importlib.util.find_spec(name, package=None)  
Find the spec for a module, optionally relative to the specified package name. If the module is in sys.modules, then sys.modules[name].__spec__ is returned (unless the spec would be None or is not set, in which case ValueError is raised). Otherwise a search using sys.meta_path is done. None is returned if no spec is found. If name is for a submodule (contains a dot), the parent module is automatically imported. name and package work the same as for import_module().  New in version 3.4.   Changed in version 3.7: Raises ModuleNotFoundError instead of AttributeError if package is in fact not a package (i.e. lacks a __path__ attribute).
class importlib.util.LazyLoader(loader)  
A class which postpones the execution of the loader of a module until the module has an attribute accessed. This class only works with loaders that define exec_module() as control over what module type is used for the module is required. For those same reasons, the loader’s create_module() method must return None or a type for which its __class__ attribute can be mutated along with not using slots. Finally, modules which substitute the object placed into sys.modules will not work as there is no way to properly replace the module references throughout the interpreter safely; ValueError is raised if such a substitution is detected.  Note For projects where startup time is critical, this class allows for potentially minimizing the cost of loading a module if it is never used. For projects where startup time is not essential then use of this class is heavily discouraged due to error messages created during loading being postponed and thus occurring out of context.   New in version 3.5.   Changed in version 3.6: Began calling create_module(), removing the compatibility warning for importlib.machinery.BuiltinImporter and importlib.machinery.ExtensionFileLoader.   
classmethod factory(loader)  
A static method which returns a callable that creates a lazy loader. This is meant to be used in situations where the loader is passed by class instead of by instance. suffixes = importlib.machinery.SOURCE_SUFFIXES
loader = importlib.machinery.SourceFileLoader
lazy_loader = importlib.util.LazyLoader.factory(loader)
finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))
classmethod factory(loader)  
A static method which returns a callable that creates a lazy loader. This is meant to be used in situations where the loader is passed by class instead of by instance. suffixes = importlib.machinery.SOURCE_SUFFIXES
loader = importlib.machinery.SourceFileLoader
lazy_loader = importlib.util.LazyLoader.factory(loader)
finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))
importlib.util.MAGIC_NUMBER  
The bytes which represent the bytecode version number. If you need help with loading/writing bytecode then consider importlib.abc.SourceLoader.  New in version 3.4.
@importlib.util.module_for_loader  
A decorator for importlib.abc.Loader.load_module() to handle selecting the proper module object to load with. The decorated method is expected to have a call signature taking two positional arguments (e.g. load_module(self, module)) for which the second argument will be the module object to be used by the loader. Note that the decorator will not work on static methods because of the assumption of two arguments. The decorated method will take in the name of the module to be loaded as expected for a loader. If the module is not found in sys.modules then a new one is constructed. Regardless of where the module came from, __loader__ set to self and __package__ is set based on what importlib.abc.InspectLoader.is_package() returns (if available). These attributes are set unconditionally to support reloading. If an exception is raised by the decorated method and a module was added to sys.modules, then the module will be removed to prevent a partially initialized module from being in left in sys.modules. If the module was already in sys.modules then it is left alone.  Changed in version 3.3: __loader__ and __package__ are automatically set (when possible).   Changed in version 3.4: Set __name__, __loader__ __package__ unconditionally to support reloading.   Deprecated since version 3.4: The import machinery now directly performs all the functionality provided by this function.
importlib.util.module_from_spec(spec)  
Create a new module based on spec and spec.loader.create_module. If spec.loader.create_module does not return None, then any pre-existing attributes will not be reset. Also, no AttributeError will be raised if triggered while accessing spec or setting an attribute on the module. This function is preferred over using types.ModuleType to create a new module as spec is used to set as many import-controlled attributes on the module as possible.  New in version 3.5.
importlib.util.resolve_name(name, package)  
Resolve a relative module name to an absolute one. If name has no leading dots, then name is simply returned. This allows for usage such as importlib.util.resolve_name('sys', __spec__.parent) without doing a check to see if the package argument is needed. ImportError is raised if name is a relative module name but package is a false value (e.g. None or the empty string). ImportError is also raised a relative name would escape its containing package (e.g. requesting ..bacon from within the spam package).  New in version 3.3.   Changed in version 3.9: To improve consistency with import statements, raise ImportError instead of ValueError for invalid relative import attempts.
@importlib.util.set_loader  
A decorator for importlib.abc.Loader.load_module() to set the __loader__ attribute on the returned module. If the attribute is already set the decorator does nothing. It is assumed that the first positional argument to the wrapped method (i.e. self) is what __loader__ should be set to.  Changed in version 3.4: Set __loader__ if set to None, as if the attribute does not exist.   Deprecated since version 3.4: The import machinery takes care of this automatically.
@importlib.util.set_package  
A decorator for importlib.abc.Loader.load_module() to set the __package__ attribute on the returned module. If __package__ is set and has a value other than None it will not be changed.  Deprecated since version 3.4: The import machinery takes care of this automatically.
importlib.util.source_from_cache(path)  
Given the path to a PEP 3147 file name, return the associated source code file path. For example, if path is /foo/bar/__pycache__/baz.cpython-32.pyc the returned path would be /foo/bar/baz.py. path need not exist, however if it does not conform to PEP 3147 or PEP 488 format, a ValueError is raised. If sys.implementation.cache_tag is not defined, NotImplementedError is raised.  New in version 3.4.   Changed in version 3.6: Accepts a path-like object.
importlib.util.source_hash(source_bytes)  
Return the hash of source_bytes as bytes. A hash-based .pyc file embeds the source_hash() of the corresponding source file’s contents in its header.  New in version 3.7.
importlib.util.spec_from_file_location(name, location, *, loader=None, submodule_search_locations=None)  
A factory function for creating a ModuleSpec instance based on the path to a file. Missing information will be filled in on the spec by making use of loader APIs and by the implication that the module will be file-based.  New in version 3.4.   Changed in version 3.6: Accepts a path-like object.
importlib.util.spec_from_loader(name, loader, *, origin=None, is_package=None)  
A factory function for creating a ModuleSpec instance based on a loader. The parameters have the same meaning as they do for ModuleSpec. The function uses available loader APIs, such as InspectLoader.is_package(), to fill in any missing information on the spec.  New in version 3.4.
importlib.__import__(name, globals=None, locals=None, fromlist=(), level=0)  
An implementation of the built-in __import__() function.  Note Programmatic importing of modules should use import_module() instead of this function.
exception ImportWarning  
Base class for warnings about probable mistakes in module imports. Ignored by the default warning filters. Enabling the Python Development Mode shows this warning.
exception IndentationError  
Base class for syntax errors related to incorrect indentation. This is a subclass of SyntaxError.
exception IndexError  
Raised when a sequence subscript is out of range. (Slice indices are silently truncated to fall in the allowed range; if an index is not an integer, TypeError is raised.)
input([prompt])  
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example: >>> s = input('--> ')  
--> Monty Python's Flying Circus
>>> s  
"Monty Python's Flying Circus"
 If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.
Raises an auditing event builtins.input with argument prompt before reading input
Raises an auditing event builtins.input/result with the result after successfully reading input.
class inspect.BoundArguments  
Result of a Signature.bind() or Signature.bind_partial() call. Holds the mapping of arguments to the function’s parameters.  
arguments  
A mutable mapping of parameters’ names to arguments’ values. Contains only explicitly bound arguments. Changes in arguments will reflect in args and kwargs. Should be used in conjunction with Signature.parameters for any argument processing purposes.  Note Arguments for which Signature.bind() or Signature.bind_partial() relied on a default value are skipped. However, if needed, use BoundArguments.apply_defaults() to add them.   Changed in version 3.9: arguments is now of type dict. Formerly, it was of type collections.OrderedDict.  
  
args  
A tuple of positional arguments values. Dynamically computed from the arguments attribute. 
  
kwargs  
A dict of keyword arguments values. Dynamically computed from the arguments attribute. 
  
signature  
A reference to the parent Signature object. 
  
apply_defaults()  
Set default values for missing arguments. For variable-positional arguments (*args) the default is an empty tuple. For variable-keyword arguments (**kwargs) the default is an empty dict. >>> def foo(a, b='ham', *args): pass
>>> ba = inspect.signature(foo).bind('spam')
>>> ba.apply_defaults()
>>> ba.arguments
{'a': 'spam', 'b': 'ham', 'args': ()}
  New in version 3.5.  
 The args and kwargs properties can be used to invoke functions: def test(a, *, b):
    ...

sig = signature(test)
ba = sig.bind(10, b=20)
test(*ba.args, **ba.kwargs)
apply_defaults()  
Set default values for missing arguments. For variable-positional arguments (*args) the default is an empty tuple. For variable-keyword arguments (**kwargs) the default is an empty dict. >>> def foo(a, b='ham', *args): pass
>>> ba = inspect.signature(foo).bind('spam')
>>> ba.apply_defaults()
>>> ba.arguments
{'a': 'spam', 'b': 'ham', 'args': ()}
  New in version 3.5.
arguments  
A mutable mapping of parameters’ names to arguments’ values. Contains only explicitly bound arguments. Changes in arguments will reflect in args and kwargs. Should be used in conjunction with Signature.parameters for any argument processing purposes.  Note Arguments for which Signature.bind() or Signature.bind_partial() relied on a default value are skipped. However, if needed, use BoundArguments.apply_defaults() to add them.   Changed in version 3.9: arguments is now of type dict. Formerly, it was of type collections.OrderedDict.
inspect.cleandoc(doc)  
Clean up indentation from docstrings that are indented to line up with blocks of code. All leading whitespace is removed from the first line. Any leading whitespace that can be uniformly removed from the second line onwards is removed. Empty lines at the beginning and end are subsequently removed. Also, all tabs are expanded to spaces.
inspect.CO_ASYNC_GENERATOR  
The flag is set when the code object is an asynchronous generator function. When the code object is executed it returns an asynchronous generator object. See PEP 525 for more details.  New in version 3.6.
inspect.CO_COROUTINE  
The flag is set when the code object is a coroutine function. When the code object is executed it returns a coroutine object. See PEP 492 for more details.  New in version 3.5.
inspect.CO_GENERATOR  
The flag is set when the code object is a generator function, i.e. a generator object is returned when the code object is executed.
inspect.CO_ITERABLE_COROUTINE  
The flag is used to transform generators into generator-based coroutines. Generator objects with this flag can be used in await expression, and can yield from coroutine objects. See PEP 492 for more details.  New in version 3.5.
inspect.CO_NESTED  
The flag is set when the code object is a nested function.
inspect.CO_NEWLOCALS  
If set, a new dict will be created for the frame’s f_locals when the code object is executed.
inspect.CO_NOFREE  
The flag is set if there are no free or cell variables.
inspect.CO_VARARGS  
The code object has a variable positional parameter (*args-like).
inspect.CO_VARKEYWORDS  
The code object has a variable keyword parameter (**kwargs-like).
inspect.currentframe()  
Return the frame object for the caller’s stack frame.  CPython implementation detail: This function relies on Python stack frame support in the interpreter, which isn’t guaranteed to exist in all implementations of Python. If running in an implementation without Python stack frame support this function returns None.
inspect.formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations[, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations]])  
Format a pretty argument spec from the values returned by getfullargspec(). The first seven arguments are (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations). The other six arguments are functions that are called to turn argument names, * argument name, ** argument name, default values, return annotation and individual annotations into strings, respectively. For example: >>> from inspect import formatargspec, getfullargspec
>>> def f(a: int, b: float):
...     pass
...
>>> formatargspec(*getfullargspec(f))
'(a: int, b: float)'
  Deprecated since version 3.5: Use signature() and Signature Object, which provide a better introspecting API for callables.
inspect.formatargvalues(args[, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue])  
Format a pretty argument spec from the four values returned by getargvalues(). The format* arguments are the corresponding optional formatting functions that are called to turn names and values into strings.  Note This function was inadvertently marked as deprecated in Python 3.5.
inspect.getargspec(func)  
Get the names and default values of a Python function’s parameters. A named tuple ArgSpec(args, varargs, keywords, defaults) is returned. args is a list of the parameter names. varargs and keywords are the names of the * and ** parameters or None. defaults is a tuple of default argument values or None if there are no default arguments; if this tuple has n elements, they correspond to the last n elements listed in args.  Deprecated since version 3.0: Use getfullargspec() for an updated API that is usually a drop-in replacement, but also correctly handles function annotations and keyword-only parameters. Alternatively, use signature() and Signature Object, which provide a more structured introspection API for callables.
inspect.getargvalues(frame)  
Get information about arguments passed into a particular frame. A named tuple ArgInfo(args, varargs, keywords, locals) is returned. args is a list of the argument names. varargs and keywords are the names of the * and ** arguments or None. locals is the locals dictionary of the given frame.  Note This function was inadvertently marked as deprecated in Python 3.5.
inspect.getattr_static(obj, attr, default=None)  
Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__() or __getattribute__(). Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can’t (like descriptors that raise AttributeError). It can also return descriptors objects instead of instance members. If the instance __dict__ is shadowed by another member (for example a property) then this function will be unable to find instance members.  New in version 3.2.
inspect.getcallargs(func, /, *args, **kwds)  
Bind the args and kwds to the argument names of the Python function or method func, as if it was called with them. For bound methods, bind also the first argument (typically named self) to the associated instance. A dict is returned, mapping the argument names (including the names of the * and ** arguments, if any) to their values from args and kwds. In case of invoking func incorrectly, i.e. whenever func(*args, **kwds) would raise an exception because of incompatible signature, an exception of the same type and the same or similar message is raised. For example: >>> from inspect import getcallargs
>>> def f(a, b=1, *pos, **named):
...     pass
>>> getcallargs(f, 1, 2, 3) == {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
True
>>> getcallargs(f, a=2, x=4) == {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
True
>>> getcallargs(f)
Traceback (most recent call last):
...
TypeError: f() missing 1 required positional argument: 'a'
  New in version 3.2.   Deprecated since version 3.5: Use Signature.bind() and Signature.bind_partial() instead.
inspect.getclasstree(classes, unique=False)  
Arrange the given list of classes into a hierarchy of nested lists. Where a nested list appears, it contains classes derived from the class whose entry immediately precedes the list. Each entry is a 2-tuple containing a class and a tuple of its base classes. If the unique argument is true, exactly one entry appears in the returned structure for each class in the given list. Otherwise, classes using multiple inheritance and their descendants will appear multiple times.
inspect.getclosurevars(func)  
Get the mapping of external name references in a Python function or method func to their current values. A named tuple ClosureVars(nonlocals, globals, builtins, unbound) is returned. nonlocals maps referenced names to lexical closure variables, globals to the function’s module globals and builtins to the builtins visible from the function body. unbound is the set of names referenced in the function that could not be resolved at all given the current module globals and builtins. TypeError is raised if func is not a Python function or method.  New in version 3.3.
inspect.getcomments(object)  
Return in a single string any lines of comments immediately preceding the object’s source code (for a class, function, or method), or at the top of the Python source file (if the object is a module). If the object’s source code is unavailable, return None. This could happen if the object has been defined in C or the interactive shell.
inspect.getcoroutinelocals(coroutine)  
This function is analogous to getgeneratorlocals(), but works for coroutine objects created by async def functions.  New in version 3.5.
inspect.getcoroutinestate(coroutine)  
Get current state of a coroutine object. The function is intended to be used with coroutine objects created by async def functions, but will accept any coroutine-like object that has cr_running and cr_frame attributes.  Possible states are:

 CORO_CREATED: Waiting to start execution. CORO_RUNNING: Currently being executed by the interpreter. CORO_SUSPENDED: Currently suspended at an await expression. CORO_CLOSED: Execution has completed.     New in version 3.5.
inspect.getdoc(object)  
Get the documentation string for an object, cleaned up with cleandoc(). If the documentation string for an object is not provided and the object is a class, a method, a property or a descriptor, retrieve the documentation string from the inheritance hierarchy.  Changed in version 3.5: Documentation strings are now inherited if not overridden.
inspect.getfile(object)  
Return the name of the (text or binary) file in which an object was defined. This will fail with a TypeError if the object is a built-in module, class, or function.
inspect.getframeinfo(frame, context=1)  
Get information about a frame or traceback object. A named tuple Traceback(filename, lineno, function, code_context, index) is returned.