neulab/docprompting-conala huggingface dataset:
base64.b16decode(s, casefold=False)  
Decode the Base16 encoded bytes-like object or ASCII string s and return the decoded bytes. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. A binascii.Error is raised if s is incorrectly padded or if there are non-alphabet characters present in the input.
base64.b16encode(s)  
Encode the bytes-like object s using Base16 and return the encoded bytes.
base64.b32decode(s, casefold=False, map01=None)  
Decode the Base32 encoded bytes-like object or ASCII string s and return the decoded bytes. Optional casefold is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is False. RFC 3548 allows for optional mapping of the digit 0 (zero) to the letter O (oh), and for optional mapping of the digit 1 (one) to either the letter I (eye) or letter L (el). The optional argument map01 when not None, specifies which letter the digit 1 should be mapped to (when map01 is not None, the digit 0 is always mapped to the letter O). For security purposes the default is None, so that 0 and 1 are not allowed in the input. A binascii.Error is raised if s is incorrectly padded or if there are non-alphabet characters present in the input.
base64.b32encode(s)  
Encode the bytes-like object s using Base32 and return the encoded bytes.
base64.b64decode(s, altchars=None, validate=False)  
Decode the Base64 encoded bytes-like object or ASCII string s and return the decoded bytes. Optional altchars must be a bytes-like object or ASCII string of at least length 2 (additional characters are ignored) which specifies the alternative alphabet used instead of the + and / characters. A binascii.Error exception is raised if s is incorrectly padded. If validate is False (the default), characters that are neither in the normal base-64 alphabet nor the alternative alphabet are discarded prior to the padding check. If validate is True, these non-alphabet characters in the input result in a binascii.Error.
base64.b64encode(s, altchars=None)  
Encode the bytes-like object s using Base64 and return the encoded bytes. Optional altchars must be a bytes-like object of at least length 2 (additional characters are ignored) which specifies an alternative alphabet for the + and / characters. This allows an application to e.g. generate URL or filesystem safe Base64 strings. The default is None, for which the standard Base64 alphabet is used.
base64.b85decode(b)  
Decode the base85-encoded bytes-like object or ASCII string b and return the decoded bytes. Padding is implicitly removed, if necessary.  New in version 3.4.
base64.b85encode(b, pad=False)  
Encode the bytes-like object b using base85 (as used in e.g. git-style binary diffs) and return the encoded bytes. If pad is true, the input is padded with b'\0' so its length is a multiple of 4 bytes before encoding.  New in version 3.4.
base64.decode(input, output)  
Decode the contents of the binary input file and write the resulting binary data to the output file. input and output must be file objects. input will be read until input.readline() returns an empty bytes object.
base64.decodebytes(s)  
Decode the bytes-like object s, which must contain one or more lines of base64 encoded data, and return the decoded bytes.  New in version 3.1.
base64.encode(input, output)  
Encode the contents of the binary input file and write the resulting base64 encoded data to the output file. input and output must be file objects. input will be read until input.read() returns an empty bytes object. encode() inserts a newline character (b'\n') after every 76 bytes of the output, as well as ensuring that the output always ends with a newline, as per RFC 2045 (MIME).
base64.encodebytes(s)  
Encode the bytes-like object s, which can contain arbitrary binary data, and return bytes containing the base64-encoded data, with newlines (b'\n') inserted after every 76 bytes of output, and ensuring that there is a trailing newline, as per RFC 2045 (MIME).  New in version 3.1.
base64.standard_b64decode(s)  
Decode bytes-like object or ASCII string s using the standard Base64 alphabet and return the decoded bytes.
base64.standard_b64encode(s)  
Encode bytes-like object s using the standard Base64 alphabet and return the encoded bytes.
base64.urlsafe_b64decode(s)  
Decode bytes-like object or ASCII string s using the URL- and filesystem-safe alphabet, which substitutes - instead of + and _ instead of / in the standard Base64 alphabet, and return the decoded bytes.
base64.urlsafe_b64encode(s)  
Encode bytes-like object s using the URL- and filesystem-safe alphabet, which substitutes - instead of + and _ instead of / in the standard Base64 alphabet, and return the encoded bytes. The result can still contain =.
exception BaseException  
The base class for all built-in exceptions. It is not meant to be directly inherited by user-defined classes (for that, use Exception). If str() is called on an instance of this class, the representation of the argument(s) to the instance are returned, or the empty string when there were no arguments.  
args  
The tuple of arguments given to the exception constructor. Some built-in exceptions (like OSError) expect a certain number of arguments and assign a special meaning to the elements of this tuple, while others are usually called only with a single string giving an error message. 
  
with_traceback(tb)  
This method sets tb as the new traceback for the exception and returns the exception object. It is usually used in exception handling code like this: try:
    ...
except SomeException:
    tb = sys.exc_info()[2]
    raise OtherException(...).with_traceback(tb)
args  
The tuple of arguments given to the exception constructor. Some built-in exceptions (like OSError) expect a certain number of arguments and assign a special meaning to the elements of this tuple, while others are usually called only with a single string giving an error message.
with_traceback(tb)  
This method sets tb as the new traceback for the exception and returns the exception object. It is usually used in exception handling code like this: try:
    ...
except SomeException:
    tb = sys.exc_info()[2]
    raise OtherException(...).with_traceback(tb)
break_anywhere(frame)  
This method checks if there is a breakpoint in the filename of the current frame.
break_here(frame)  
This method checks if there is a breakpoint in the filename and line belonging to frame or, at least, in the current function. If the breakpoint is a temporary one, this method deletes it.
canonic(filename)  
Auxiliary method for getting a filename in a canonical form, that is, as a case-normalized (on case-insensitive filesystems) absolute path, stripped of surrounding angle brackets.
clear_all_file_breaks(filename)  
Delete all breakpoints in filename. If none were set, an error message is returned.
clear_bpbynumber(arg)  
Delete the breakpoint which has the index arg in the Breakpoint.bpbynumber. If arg is not numeric or out of range, return an error message.
clear_break(filename, lineno)  
Delete the breakpoints in filename and lineno. If none were set, an error message is returned.
dispatch_call(frame, arg)  
If the debugger should stop on this function call, invoke the user_call() method (which should be overridden in subclasses). Raise a BdbQuit exception if the Bdb.quitting flag is set (which can be set from user_call()). Return a reference to the trace_dispatch() method for further tracing in that scope.
dispatch_exception(frame, arg)  
If the debugger should stop at this exception, invokes the user_exception() method (which should be overridden in subclasses). Raise a BdbQuit exception if the Bdb.quitting flag is set (which can be set from user_exception()). Return a reference to the trace_dispatch() method for further tracing in that scope.
dispatch_line(frame)  
If the debugger should stop on the current line, invoke the user_line() method (which should be overridden in subclasses). Raise a BdbQuit exception if the Bdb.quitting flag is set (which can be set from user_line()). Return a reference to the trace_dispatch() method for further tracing in that scope.
dispatch_return(frame, arg)  
If the debugger should stop on this function return, invoke the user_return() method (which should be overridden in subclasses). Raise a BdbQuit exception if the Bdb.quitting flag is set (which can be set from user_return()). Return a reference to the trace_dispatch() method for further tracing in that scope.
do_clear(arg)  
Handle how a breakpoint must be removed when it is a temporary one. This method must be implemented by derived classes.
format_stack_entry(frame_lineno, lprefix=': ')  
Return a string with information about a stack entry, identified by a (frame, lineno) tuple:  The canonical form of the filename which contains the frame. The function name, or "<lambda>". The input arguments. The return value. The line of code (if it exists).
get_bpbynumber(arg)  
Return a breakpoint specified by the given number. If arg is a string, it will be converted to a number. If arg is a non-numeric string, if the given breakpoint never existed or has been deleted, a ValueError is raised.  New in version 3.2.
get_break(filename, lineno)  
Check if there is a breakpoint for lineno of filename.
get_breaks(filename, lineno)  
Return all breakpoints for lineno in filename, or an empty list if none are set.
get_file_breaks(filename)  
Return all breakpoints in filename, or an empty list if none are set.
get_stack(f, t)  
Get a list of records for a frame and all higher (calling) and lower frames, and the size of the higher part.
reset()  
Set the botframe, stopframe, returnframe and quitting attributes with values ready to start debugging.
run(cmd, globals=None, locals=None)  
Debug a statement executed via the exec() function. globals defaults to __main__.__dict__, locals defaults to globals.
runcall(func, /, *args, **kwds)  
Debug a single function call, and return its result.
runctx(cmd, globals, locals)  
For backwards compatibility. Calls the run() method.
runeval(expr, globals=None, locals=None)  
Debug an expression executed via the eval() function. globals and locals have the same meaning as in run().
set_break(filename, lineno, temporary=0, cond, funcname)  
Set a new breakpoint. If the lineno line doesn’t exist for the filename passed as argument, return an error message. The filename should be in canonical form, as described in the canonic() method.
set_continue()  
Stop only at breakpoints or when finished. If there are no breakpoints, set the system trace function to None.
set_quit()  
Set the quitting attribute to True. This raises BdbQuit in the next call to one of the dispatch_*() methods.
set_trace([frame])  
Start debugging from frame. If frame is not specified, debugging starts from caller’s frame.
set_until(frame)  
Stop when the line with the line no greater than the current one is reached or when returning from current frame.
stop_here(frame)  
This method checks if the frame is somewhere below botframe in the call stack. botframe is the frame in which debugging started.
trace_dispatch(frame, event, arg)  
This function is installed as the trace function of debugged frames. Its return value is the new trace function (in most cases, that is, itself). The default implementation decides how to dispatch a frame, depending on the type of event (passed as a string) that is about to be executed. event can be one of the following:  
"line": A new line of code is going to be executed. 
"call": A function is about to be called, or another code block entered. 
"return": A function or other code block is about to return. 
"exception": An exception has occurred. 
"c_call": A C function is about to be called. 
"c_return": A C function has returned. 
"c_exception": A C function has raised an exception.  For the Python events, specialized functions (see below) are called. For the C events, no action is taken. The arg parameter depends on the previous event. See the documentation for sys.settrace() for more information on the trace function. For more information on code and frame objects, refer to The standard type hierarchy.
user_call(frame, argument_list)  
This method is called from dispatch_call() when there is the possibility that a break might be necessary anywhere inside the called function.
user_exception(frame, exc_info)  
This method is called from dispatch_exception() when stop_here() yields True.
user_line(frame)  
This method is called from dispatch_line() when either stop_here() or break_here() yields True.
user_return(frame, return_value)  
This method is called from dispatch_return() when stop_here() yields True.
exception bdb.BdbQuit  
Exception raised by the Bdb class for quitting the debugger.
class bdb.Breakpoint(self, file, line, temporary=0, cond=None, funcname=None)  
This class implements temporary breakpoints, ignore counts, disabling and (re-)enabling, and conditionals. Breakpoints are indexed by number through a list called bpbynumber and by (file, line) pairs through bplist. The former points to a single instance of class Breakpoint. The latter points to a list of such instances since there may be more than one breakpoint per line. When creating a breakpoint, its associated filename should be in canonical form. If a funcname is defined, a breakpoint hit will be counted when the first line of that function is executed. A conditional breakpoint always counts a hit. Breakpoint instances have the following methods:  
deleteMe()  
Delete the breakpoint from the list associated to a file/line. If it is the last breakpoint in that position, it also deletes the entry for the file/line. 
  
enable()  
Mark the breakpoint as enabled. 
  
disable()  
Mark the breakpoint as disabled. 
  
bpformat()  
Return a string with all the information about the breakpoint, nicely formatted:  The breakpoint number. If it is temporary or not. Its file,line position. The condition that causes a break. If it must be ignored the next N times. The breakpoint hit count.   New in version 3.2.  
  
bpprint(out=None)  
Print the output of bpformat() to the file out, or if it is None, to standard output.
bpformat()  
Return a string with all the information about the breakpoint, nicely formatted:  The breakpoint number. If it is temporary or not. Its file,line position. The condition that causes a break. If it must be ignored the next N times. The breakpoint hit count.   New in version 3.2.
bpprint(out=None)  
Print the output of bpformat() to the file out, or if it is None, to standard output.
deleteMe()  
Delete the breakpoint from the list associated to a file/line. If it is the last breakpoint in that position, it also deletes the entry for the file/line.
bdb.checkfuncname(b, frame)  
Check whether we should break here, depending on the way the breakpoint b was set. If it was set via line number, it checks if b.line is the same as the one in the frame also passed as argument. If the breakpoint was set via function name, we have to check we are in the right frame (the right function) and if we are in its first executable line.
bdb.effective(file, line, frame)  
Determine if there is an effective (active) breakpoint at this line of code. Return a tuple of the breakpoint and a boolean that indicates if it is ok to delete a temporary breakpoint. Return (None, None) if there is no matching breakpoint.
bdb.set_trace()  
Start debugging with a Bdb instance from caller’s frame.
bin(x)  
Convert an integer number to a binary string prefixed with “0b”. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer. Some examples: >>> bin(3)
'0b11'
>>> bin(-10)
'-0b1010'
 If prefix “0b” is desired or not, you can use either of the following ways. >>> format(14, '#b'), format(14, 'b')
('0b1110', '1110')
>>> f'{14:#b}', f'{14:b}'
('0b1110', '1110')
 See also format() for more information.
binascii.a2b_base64(string)  
Convert a block of base64 data back to binary and return the binary data. More than one line may be passed at a time.
binascii.a2b_hex(hexstr)  
binascii.unhexlify(hexstr)  
Return the binary data represented by the hexadecimal string hexstr. This function is the inverse of b2a_hex(). hexstr must contain an even number of hexadecimal digits (which can be upper or lower case), otherwise an Error exception is raised. Similar functionality (accepting only text string arguments, but more liberal towards whitespace) is also accessible using the bytes.fromhex() class method.
binascii.a2b_hqx(string)  
Convert binhex4 formatted ASCII data to binary, without doing RLE-decompression. The string should contain a complete number of binary bytes, or (in case of the last portion of the binhex4 data) have the remaining bits zero.  Deprecated since version 3.9.
binascii.a2b_qp(data, header=False)  
Convert a block of quoted-printable data back to binary and return the binary data. More than one line may be passed at a time. If the optional argument header is present and true, underscores will be decoded as spaces.
binascii.a2b_uu(string)  
Convert a single line of uuencoded data back to binary and return the binary data. Lines normally contain 45 (binary) bytes, except for the last line. Line data may be followed by whitespace.
binascii.b2a_base64(data, *, newline=True)  
Convert binary data to a line of ASCII characters in base64 coding. The return value is the converted line, including a newline char if newline is true. The output of this function conforms to RFC 3548.  Changed in version 3.6: Added the newline parameter.
binascii.b2a_hex(data[, sep[, bytes_per_sep=1]])  
binascii.hexlify(data[, sep[, bytes_per_sep=1]])  
Return the hexadecimal representation of the binary data. Every byte of data is converted into the corresponding 2-digit hex representation. The returned bytes object is therefore twice as long as the length of data. Similar functionality (but returning a text string) is also conveniently accessible using the bytes.hex() method. If sep is specified, it must be a single character str or bytes object. It will be inserted in the output after every bytes_per_sep input bytes. Separator placement is counted from the right end of the output by default, if you wish to count from the left, supply a negative bytes_per_sep value. >>> import binascii
>>> binascii.b2a_hex(b'\xb9\x01\xef')
b'b901ef'
>>> binascii.hexlify(b'\xb9\x01\xef', '-')
b'b9-01-ef'
>>> binascii.b2a_hex(b'\xb9\x01\xef', b'_', 2)
b'b9_01ef'
>>> binascii.b2a_hex(b'\xb9\x01\xef', b' ', -2)
b'b901 ef'
  Changed in version 3.8: The sep and bytes_per_sep parameters were added.
binascii.b2a_hqx(data)  
Perform hexbin4 binary-to-ASCII translation and return the resulting string. The argument should already be RLE-coded, and have a length divisible by 3 (except possibly the last fragment).  Deprecated since version 3.9.
binascii.b2a_qp(data, quotetabs=False, istext=True, header=False)  
Convert binary data to a line(s) of ASCII characters in quoted-printable encoding. The return value is the converted line(s). If the optional argument quotetabs is present and true, all tabs and spaces will be encoded. If the optional argument istext is present and true, newlines are not encoded but trailing whitespace will be encoded. If the optional argument header is present and true, spaces will be encoded as underscores per RFC 1522. If the optional argument header is present and false, newline characters will be encoded as well; otherwise linefeed conversion might corrupt the binary data stream.
binascii.b2a_uu(data, *, backtick=False)  
Convert binary data to a line of ASCII characters, the return value is the converted line, including a newline char. The length of data should be at most 45. If backtick is true, zeros are represented by '`' instead of spaces.  Changed in version 3.7: Added the backtick parameter.
binascii.crc32(data[, value])  
Compute CRC-32, the 32-bit checksum of data, starting with an initial CRC of value. The default initial CRC is zero. The algorithm is consistent with the ZIP file checksum. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Use as follows: print(binascii.crc32(b"hello world"))
# Or, in two pieces:
crc = binascii.crc32(b"hello")
crc = binascii.crc32(b" world", crc)
print('crc32 = {:#010x}'.format(crc))
  Changed in version 3.0: The result is always unsigned. To generate the same numeric value across all Python versions and platforms, use crc32(data) & 0xffffffff.
binascii.crc_hqx(data, value)  
Compute a 16-bit CRC value of data, starting with value as the initial CRC, and return the result. This uses the CRC-CCITT polynomial x16 + x12 + x5 + 1, often represented as 0x1021. This CRC is used in the binhex4 format.
exception binascii.Incomplete  
Exception raised on incomplete data. These are usually not programming errors, but may be handled by reading a little more data and trying again.
binascii.rlecode_hqx(data)  
Perform binhex4 style RLE-compression on data and return the result.  Deprecated since version 3.9.
binascii.rledecode_hqx(data)  
Perform RLE-decompression on the data, as per the binhex4 standard. The algorithm uses 0x90 after a byte as a repeat indicator, followed by a count. A count of 0 specifies a byte value of 0x90. The routine returns the decompressed data, unless data input data ends in an orphaned repeat indicator, in which case the Incomplete exception is raised.  Changed in version 3.2: Accept only bytestring or bytearray objects as input.   Deprecated since version 3.9.
binhex — Encode and decode binhex4 files Source code: Lib/binhex.py  Deprecated since version 3.9.  This module encodes and decodes files in binhex4 format, a format allowing representation of Macintosh files in ASCII. Only the data fork is handled. The binhex module defines the following functions:  
binhex.binhex(input, output)  
Convert a binary file with filename input to binhex file output. The output parameter can either be a filename or a file-like object (any object supporting a write() and close() method). 
  
binhex.hexbin(input, output)  
Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. The resulting file is written to a file named output, unless the argument is None in which case the output filename is read from the binhex file. 
 The following exception is also defined:  
exception binhex.Error  
Exception raised when something can’t be encoded using the binhex format (for example, a filename is too long to fit in the filename field), or when input is not properly encoded binhex data. 
  See also  
Module binascii


Support module containing ASCII-to-binary and binary-to-ASCII conversions.    Notes There is an alternative, more powerful interface to the coder and decoder, see the source for details. If you code or decode textfiles on non-Macintosh platforms they will still use the old Macintosh newline convention (carriage-return as end of line).
binhex.binhex(input, output)  
Convert a binary file with filename input to binhex file output. The output parameter can either be a filename or a file-like object (any object supporting a write() and close() method).
exception binhex.Error  
Exception raised when something can’t be encoded using the binhex format (for example, a filename is too long to fit in the filename field), or when input is not properly encoded binhex data.
binhex.hexbin(input, output)  
Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. The resulting file is written to a file named output, unless the argument is None in which case the output filename is read from the binhex file.
bisect.bisect_right(a, x, lo=0, hi=len(a))  
bisect.bisect(a, x, lo=0, hi=len(a))  
Similar to bisect_left(), but returns an insertion point which comes after (to the right of) any existing entries of x in a. The returned insertion point i partitions the array a into two halves so that all(val <= x for val in a[lo:i]) for the left side and all(val > x for val in a[i:hi]) for the right side.