neulab/docprompting-conala huggingface dataset:
re.X  
re.VERBOSE  
This flag allows you to write regular expressions that look nicer and are more readable by allowing you to visually separate logical sections of the pattern and add comments. Whitespace within the pattern is ignored, except when in a character class, or when preceded by an unescaped backslash, or within tokens like *?, (?: or (?P<...>. When a line contains a # that is not in a character class and is not preceded by an unescaped backslash, all characters from the leftmost such # through the end of the line are ignored. This means that the two following regular expression objects that match a decimal number are functionally equal: a = re.compile(r"""\d +  # the integral part
                   \.    # the decimal point
                   \d *  # some fractional digits""", re.X)
b = re.compile(r"\d+\.\d*")
 Corresponds to the inline flag (?x).
readline.add_history(line)  
Append line to the history buffer, as if it was the last line typed. This calls add_history() in the underlying library.
readline.append_history_file(nelements[, filename])  
Append the last nelements items of history to a file. The default filename is ~/.history. The file must already exist. This calls append_history() in the underlying library. This function only exists if Python was compiled for a version of the library that supports it.  New in version 3.5.
readline.clear_history()  
Clear the current history. This calls clear_history() in the underlying library. The Python function only exists if Python was compiled for a version of the library that supports it.
readline.get_begidx()  
readline.get_endidx()  
Get the beginning or ending index of the completion scope. These indexes are the start and end arguments passed to the rl_attempted_completion_function callback of the underlying library.
readline.get_completer()  
Get the completer function, or None if no completer function has been set.
readline.set_completer_delims(string)  
readline.get_completer_delims()  
Set or get the word delimiters for completion. These determine the start of the word to be considered for completion (the completion scope). These functions access the rl_completer_word_break_characters variable in the underlying library.
readline.get_completion_type()  
Get the type of completion being attempted. This returns the rl_completion_type variable in the underlying library as an integer.
readline.get_current_history_length()  
Return the number of items currently in the history. (This is different from get_history_length(), which returns the maximum number of lines that will be written to a history file.)
readline.get_history_item(index)  
Return the current contents of history item at index. The item index is one-based. This calls history_get() in the underlying library.
readline.get_history_length()  
readline.set_history_length(length)  
Set or return the desired number of lines to save in the history file. The write_history_file() function uses this value to truncate the history file, by calling history_truncate_file() in the underlying library. Negative values imply unlimited history file size.
readline.get_line_buffer()  
Return the current contents of the line buffer (rl_line_buffer in the underlying library).
readline.insert_text(string)  
Insert text into the line buffer at the cursor position. This calls rl_insert_text() in the underlying library, but ignores the return value.
readline.parse_and_bind(string)  
Execute the init line provided in the string argument. This calls rl_parse_and_bind() in the underlying library.
readline.read_history_file([filename])  
Load a readline history file, and append it to the history list. The default filename is ~/.history. This calls read_history() in the underlying library.
readline.read_init_file([filename])  
Execute a readline initialization file. The default filename is the last filename used. This calls rl_read_init_file() in the underlying library.
readline.redisplay()  
Change what’s displayed on the screen to reflect the current contents of the line buffer. This calls rl_redisplay() in the underlying library.
readline.remove_history_item(pos)  
Remove history item specified by its position from the history. The position is zero-based. This calls remove_history() in the underlying library.
readline.replace_history_item(pos, line)  
Replace history item specified by its position with line. The position is zero-based. This calls replace_history_entry() in the underlying library.
readline.set_auto_history(enabled)  
Enable or disable automatic calls to add_history() when reading input via readline. The enabled argument should be a Boolean value that when true, enables auto history, and that when false, disables auto history.  New in version 3.6.   CPython implementation detail: Auto history is enabled by default, and changes to this do not persist across multiple sessions.
readline.set_completer([function])  
Set or remove the completer function. If function is specified, it will be used as the new completer function; if omitted or None, any completer function already installed is removed. The completer function is called as function(text, state), for state in 0, 1, 2, …, until it returns a non-string value. It should return the next possible completion starting with text. The installed completer function is invoked by the entry_func callback passed to rl_completion_matches() in the underlying library. The text string comes from the first parameter to the rl_attempted_completion_function callback of the underlying library.
readline.set_completion_display_matches_hook([function])  
Set or remove the completion display function. If function is specified, it will be used as the new completion display function; if omitted or None, any completion display function already installed is removed. This sets or clears the rl_completion_display_matches_hook callback in the underlying library. The completion display function is called as function(substitution, [matches], longest_match_length) once each time matches need to be displayed.
readline.set_pre_input_hook([function])  
Set or remove the function invoked by the rl_pre_input_hook callback of the underlying library. If function is specified, it will be used as the new hook function; if omitted or None, any function already installed is removed. The hook is called with no arguments after the first prompt has been printed and just before readline starts reading input characters. This function only exists if Python was compiled for a version of the library that supports it.
readline.set_startup_hook([function])  
Set or remove the function invoked by the rl_startup_hook callback of the underlying library. If function is specified, it will be used as the new hook function; if omitted or None, any function already installed is removed. The hook is called with no arguments just before readline prints the first prompt.
readline.write_history_file([filename])  
Save the history list to a readline history file, overwriting any existing file. The default filename is ~/.history. This calls write_history() in the underlying library.
exception RecursionError  
This exception is derived from RuntimeError. It is raised when the interpreter detects that the maximum recursion depth (see sys.getrecursionlimit()) is exceeded.  New in version 3.5: Previously, a plain RuntimeError was raised.
exception ReferenceError  
This exception is raised when a weak reference proxy, created by the weakref.proxy() function, is used to access an attribute of the referent after it has been garbage collected. For more information on weak references, see the weakref module.
repr(object)  
Return a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a __repr__() method.
reprlib.aRepr  
This is an instance of Repr which is used to provide the repr() function described below. Changing the attributes of this object will affect the size limits used by repr() and the Python debugger.
@reprlib.recursive_repr(fillvalue="...")  
Decorator for __repr__() methods to detect recursive calls within the same thread. If a recursive call is made, the fillvalue is returned, otherwise, the usual __repr__() call is made. For example: >>> from reprlib import recursive_repr
>>> class MyList(list):
...     @recursive_repr()
...     def __repr__(self):
...         return '<' + '|'.join(map(repr, self)) + '>'
...
>>> m = MyList('abc')
>>> m.append(m)
>>> m.append('x')
>>> print(m)
<'a'|'b'|'c'|...|'x'>
  New in version 3.2.
class reprlib.Repr  
Class which provides formatting services useful in implementing functions similar to the built-in repr(); size limits for different object types are added to avoid the generation of representations which are excessively long.
reprlib.repr(obj)  
This is the repr() method of aRepr. It returns a string similar to that returned by the built-in function of the same name, but with limits on most sizes.
Repr.maxdict  
Repr.maxlist  
Repr.maxtuple  
Repr.maxset  
Repr.maxfrozenset  
Repr.maxdeque  
Repr.maxarray  
Limits on the number of entries represented for the named object type. The default is 4 for maxdict, 5 for maxarray, and 6 for the others.
Repr.maxlevel  
Depth limit on the creation of recursive representations. The default is 6.
Repr.maxlong  
Maximum number of characters in the representation for an integer. Digits are dropped from the middle. The default is 40.
Repr.maxother  
This limit is used to control the size of object types for which no specific formatting method is available on the Repr object. It is applied in a similar manner as maxstring. The default is 20.
Repr.maxstring  
Limit on the number of characters in the representation of the string. Note that the “normal” representation of the string is used as the character source: if escape sequences are needed in the representation, these may be mangled when the representation is shortened. The default is 30.
Repr.repr(obj)  
The equivalent to the built-in repr() that uses the formatting imposed by the instance.
Repr.repr1(obj, level)  
Recursive implementation used by repr(). This uses the type of obj to determine which formatting method to call, passing it obj and level. The type-specific methods should call repr1() to perform recursive formatting, with level - 1 for the value of level in the recursive call.
BaseHandler.<protocol>_request(req)  
This method is not defined in BaseHandler, but subclasses should define it if they want to pre-process requests of the given protocol. This method, if defined, will be called by the parent OpenerDirector. req will be a Request object. The return value should be a Request object.
exception resource.error  
A deprecated alias of OSError.  Changed in version 3.3: Following PEP 3151, this class was made an alias of OSError.
resource.getpagesize()  
Returns the number of bytes in a system page. (This need not be the same as the hardware page size.)
resource.getrlimit(resource)  
Returns a tuple (soft, hard) with the current soft and hard limits of resource. Raises ValueError if an invalid resource is specified, or error if the underlying system call fails unexpectedly.
resource.getrusage(who)  
This function returns an object that describes the resources consumed by either the current process or its children, as specified by the who parameter. The who parameter should be specified using one of the RUSAGE_* constants described below. A simple example: from resource import *
import time

# a non CPU-bound task
time.sleep(3)
print(getrusage(RUSAGE_SELF))

# a CPU-bound task
for i in range(10 ** 8):
   _ = 1 + 1
print(getrusage(RUSAGE_SELF))
 The fields of the return value each describe how a particular system resource has been used, e.g. amount of time spent running is user mode or number of times the process was swapped out of main memory. Some values are dependent on the clock tick internal, e.g. the amount of memory the process is using. For backward compatibility, the return value is also accessible as a tuple of 16 elements. The fields ru_utime and ru_stime of the return value are floating point values representing the amount of time spent executing in user mode and the amount of time spent executing in system mode, respectively. The remaining values are integers. Consult the getrusage(2) man page for detailed information about these values. A brief summary is presented here:   
Index Field Resource   
0 ru_utime time in user mode (float seconds)  
1 ru_stime time in system mode (float seconds)  
2 ru_maxrss maximum resident set size  
3 ru_ixrss shared memory size  
4 ru_idrss unshared memory size  
5 ru_isrss unshared stack size  
6 ru_minflt page faults not requiring I/O  
7 ru_majflt page faults requiring I/O  
8 ru_nswap number of swap outs  
9 ru_inblock block input operations  
10 ru_oublock block output operations  
11 ru_msgsnd messages sent  
12 ru_msgrcv messages received  
13 ru_nsignals signals received  
14 ru_nvcsw voluntary context switches  
15 ru_nivcsw involuntary context switches   This function will raise a ValueError if an invalid who parameter is specified. It may also raise error exception in unusual circumstances.
resource.prlimit(pid, resource[, limits])  
Combines setrlimit() and getrlimit() in one function and supports to get and set the resources limits of an arbitrary process. If pid is 0, then the call applies to the current process. resource and limits have the same meaning as in setrlimit(), except that limits is optional. When limits is not given the function returns the resource limit of the process pid. When limits is given the resource limit of the process is set and the former resource limit is returned. Raises ProcessLookupError when pid can’t be found and PermissionError when the user doesn’t have CAP_SYS_RESOURCE for the process. Raises an auditing event resource.prlimit with arguments pid, resource, limits. Availability: Linux 2.6.36 or later with glibc 2.13 or later.  New in version 3.4.
resource.RLIMIT_AS  
The maximum area (in bytes) of address space which may be taken by the process.
resource.RLIMIT_CORE  
The maximum size (in bytes) of a core file that the current process can create. This may result in the creation of a partial core file if a larger core would be required to contain the entire process image.
resource.RLIMIT_CPU  
The maximum amount of processor time (in seconds) that a process can use. If this limit is exceeded, a SIGXCPU signal is sent to the process. (See the signal module documentation for information about how to catch this signal and do something useful, e.g. flush open files to disk.)
resource.RLIMIT_DATA  
The maximum size (in bytes) of the process’s heap.
resource.RLIMIT_FSIZE  
The maximum size of a file which the process may create.
resource.RLIMIT_MEMLOCK  
The maximum address space which may be locked in memory.
resource.RLIMIT_MSGQUEUE  
The number of bytes that can be allocated for POSIX message queues. Availability: Linux 2.6.8 or later.  New in version 3.4.
resource.RLIMIT_NICE  
The ceiling for the process’s nice level (calculated as 20 - rlim_cur). Availability: Linux 2.6.12 or later.  New in version 3.4.
resource.RLIMIT_NOFILE  
The maximum number of open file descriptors for the current process.
resource.RLIMIT_NPROC  
The maximum number of processes the current process may create.
resource.RLIMIT_NPTS  
The maximum number of pseudo-terminals created by this user id. Availability: FreeBSD 9 or later.  New in version 3.4.
resource.RLIMIT_OFILE  
The BSD name for RLIMIT_NOFILE.
resource.RLIMIT_RSS  
The maximum resident set size that should be made available to the process.
resource.RLIMIT_RTPRIO  
The ceiling of the real-time priority. Availability: Linux 2.6.12 or later.  New in version 3.4.
resource.RLIMIT_RTTIME  
The time limit (in microseconds) on CPU time that a process can spend under real-time scheduling without making a blocking syscall. Availability: Linux 2.6.25 or later.  New in version 3.4.
resource.RLIMIT_SBSIZE  
The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time. Availability: FreeBSD 9 or later.  New in version 3.4.
resource.RLIMIT_SIGPENDING  
The number of signals which the process may queue. Availability: Linux 2.6.8 or later.  New in version 3.4.
resource.RLIMIT_STACK  
The maximum size (in bytes) of the call stack for the current process. This only affects the stack of the main thread in a multi-threaded process.
resource.RLIMIT_SWAP  
The maximum size (in bytes) of the swap space that may be reserved or used by all of this user id’s processes. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. Please see tuning(7) for a complete description of this sysctl. Availability: FreeBSD 9 or later.  New in version 3.4.
resource.RLIMIT_VMEM  
The largest area of mapped memory which the process may occupy.
resource.RLIM_INFINITY  
Constant used to represent the limit for an unlimited resource.
resource.RUSAGE_BOTH  
Pass to getrusage() to request resources consumed by both the current process and child processes. May not be available on all systems.
resource.RUSAGE_CHILDREN  
Pass to getrusage() to request resources consumed by child processes of the calling process which have been terminated and waited for.
resource.RUSAGE_SELF  
Pass to getrusage() to request resources consumed by the calling process, which is the sum of resources used by all threads in the process.
resource.RUSAGE_THREAD  
Pass to getrusage() to request resources consumed by the current thread. May not be available on all systems.  New in version 3.2.
resource.setrlimit(resource, limits)  
Sets new limits of consumption of resource. The limits argument must be a tuple (soft, hard) of two integers describing the new limits. A value of RLIM_INFINITY can be used to request a limit that is unlimited. Raises ValueError if an invalid resource is specified, if the new soft limit exceeds the hard limit, or if a process tries to raise its hard limit. Specifying a limit of RLIM_INFINITY when the hard or system limit for that resource is not unlimited will result in a ValueError. A process with the effective UID of super-user can request any valid limit value, including unlimited, but ValueError will still be raised if the requested limit exceeds the system imposed limit. setrlimit may also raise error if the underlying system call fails. VxWorks only supports setting RLIMIT_NOFILE. Raises an auditing event resource.setrlimit with arguments resource, limits.
exception ResourceWarning  
Base class for warnings related to resource usage. Ignored by the default warning filters. Enabling the Python Development Mode shows this warning.  New in version 3.2.
BaseHandler.<protocol>_response(req, response)  
This method is not defined in BaseHandler, but subclasses should define it if they want to post-process responses of the given protocol. This method, if defined, will be called by the parent OpenerDirector. req will be a Request object. response will be an object implementing the same interface as the return value of urlopen(). The return value should implement the same interface as the return value of urlopen().
reversed(seq)  
Return a reverse iterator. seq must be an object which has a __reversed__() method or supports the sequence protocol (the __len__() method and the __getitem__() method with integer arguments starting at 0).
rlcompleter — Completion function for GNU readline Source code: Lib/rlcompleter.py The rlcompleter module defines a completion function suitable for the readline module by completing valid Python identifiers and keywords. When this module is imported on a Unix platform with the readline module available, an instance of the Completer class is automatically created and its complete() method is set as the readline completer. Example: >>> import rlcompleter
>>> import readline
>>> readline.parse_and_bind("tab: complete")
>>> readline. <TAB PRESSED>
readline.__doc__          readline.get_line_buffer(  readline.read_init_file(
readline.__file__         readline.insert_text(      readline.set_completer(
readline.__name__         readline.parse_and_bind(
>>> readline.
 The rlcompleter module is designed for use with Python’s interactive mode. Unless Python is run with the -S option, the module is automatically imported and configured (see Readline configuration). On platforms without readline, the Completer class defined by this module can still be used for custom purposes. Completer Objects Completer objects have the following method:  
Completer.complete(text, state)  
Return the stateth completion for text. If called for text that doesn’t include a period character ('.'), it will complete from names currently defined in __main__, builtins and keywords (as defined by the keyword module). If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to __getattr__()) up to the last part, and find matches for the rest via the dir() function. Any exception raised during the evaluation of the expression is caught, silenced and None is returned.
Completer.complete(text, state)  
Return the stateth completion for text. If called for text that doesn’t include a period character ('.'), it will complete from names currently defined in __main__, builtins and keywords (as defined by the keyword module). If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to __getattr__()) up to the last part, and find matches for the rest via the dir() function. Any exception raised during the evaluation of the expression is caught, silenced and None is returned.
round(number[, ndigits])  
Return number rounded to ndigits precision after the decimal point. If ndigits is omitted or is None, it returns the nearest integer to its input. For the built-in types supporting round(), values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done toward the even choice (so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2). Any integer value is valid for ndigits (positive, zero, or negative). The return value is an integer if ndigits is omitted or None. Otherwise the return value has the same type as number. For a general Python object number, round delegates to number.__round__.  Note The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it’s a result of the fact that most decimal fractions can’t be represented exactly as a float. See Floating Point Arithmetic: Issues and Limitations for more information.