neulab/docprompting-conala huggingface dataset:
cmath.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)  
Return True if the values a and b are close to each other and False otherwise. Whether or not two values are considered close is determined according to given absolute and relative tolerances. rel_tol is the relative tolerance – it is the maximum allowed difference between a and b, relative to the larger absolute value of a or b. For example, to set a tolerance of 5%, pass rel_tol=0.05. The default tolerance is 1e-09, which assures that the two values are the same within about 9 decimal digits. rel_tol must be greater than zero. abs_tol is the minimum absolute tolerance – useful for comparisons near zero. abs_tol must be at least zero. If no errors occur, the result will be: abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol). The IEEE 754 special values of NaN, inf, and -inf will be handled according to IEEE rules. Specifically, NaN is not considered close to any other value, including NaN. inf and -inf are only considered close to themselves.  New in version 3.5.   See also PEP 485 – A function for testing approximate equality
cmath.isfinite(x)  
Return True if both the real and imaginary parts of x are finite, and False otherwise.  New in version 3.2.
cmath.isinf(x)  
Return True if either the real or the imaginary part of x is an infinity, and False otherwise.
cmath.isnan(x)  
Return True if either the real or the imaginary part of x is a NaN, and False otherwise.
cmath.log(x[, base])  
Returns the logarithm of x to the given base. If the base is not specified, returns the natural logarithm of x. There is one branch cut, from 0 along the negative real axis to -∞, continuous from above.
cmath.log10(x)  
Return the base-10 logarithm of x. This has the same branch cut as log().
cmath.nan  
A floating-point “not a number” (NaN) value. Equivalent to float('nan').  New in version 3.6.
cmath.nanj  
Complex number with zero real part and NaN imaginary part. Equivalent to complex(0.0, float('nan')).  New in version 3.6.
cmath.phase(x)  
Return the phase of x (also known as the argument of x), as a float. phase(x) is equivalent to math.atan2(x.imag,
x.real). The result lies in the range [-π, π], and the branch cut for this operation lies along the negative real axis, continuous from above. On systems with support for signed zeros (which includes most systems in current use), this means that the sign of the result is the same as the sign of x.imag, even when x.imag is zero: >>> phase(complex(-1.0, 0.0))
3.141592653589793
>>> phase(complex(-1.0, -0.0))
-3.141592653589793
cmath.polar(x)  
Return the representation of x in polar coordinates. Returns a pair (r, phi) where r is the modulus of x and phi is the phase of x. polar(x) is equivalent to (abs(x),
phase(x)).
cmath.rect(r, phi)  
Return the complex number x with polar coordinates r and phi. Equivalent to r * (math.cos(phi) + math.sin(phi)*1j).
cmath.sqrt(x)  
Return the square root of x. This has the same branch cut as log().
cmath.tau  
The mathematical constant τ, as a float.  New in version 3.6.
class cmd.Cmd(completekey='tab', stdin=None, stdout=None)  
A Cmd instance or subclass instance is a line-oriented interpreter framework. There is no good reason to instantiate Cmd itself; rather, it’s useful as a superclass of an interpreter class you define yourself in order to inherit Cmd’s methods and encapsulate action methods. The optional argument completekey is the readline name of a completion key; it defaults to Tab. If completekey is not None and readline is available, command completion is done automatically. The optional arguments stdin and stdout specify the input and output file objects that the Cmd instance or subclass instance will use for input and output. If not specified, they will default to sys.stdin and sys.stdout. If you want a given stdin to be used, make sure to set the instance’s use_rawinput attribute to False, otherwise stdin will be ignored.
Cmd.cmdloop(intro=None)  
Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument. The optional argument is a banner or intro string to be issued before the first prompt (this overrides the intro class attribute). If the readline module is loaded, input will automatically inherit bash-like history-list editing (e.g. Control-P scrolls back to the last command, Control-N forward to the next one, Control-F moves the cursor to the right non-destructively, Control-B moves the cursor to the left non-destructively, etc.). An end-of-file on input is passed back as the string 'EOF'. An interpreter instance will recognize a command name foo if and only if it has a method do_foo(). As a special case, a line beginning with the character '?' is dispatched to the method do_help(). As another special case, a line beginning with the character '!' is dispatched to the method do_shell() (if such a method is defined). This method will return when the postcmd() method returns a true value. The stop argument to postcmd() is the return value from the command’s corresponding do_*() method. If completion is enabled, completing commands will be done automatically, and completing of commands args is done by calling complete_foo() with arguments text, line, begidx, and endidx. text is the string prefix we are attempting to match: all returned matches must begin with it. line is the current input line with leading whitespace removed, begidx and endidx are the beginning and ending indexes of the prefix text, which could be used to provide different completion depending upon which position the argument is in. All subclasses of Cmd inherit a predefined do_help(). This method, called with an argument 'bar', invokes the corresponding method help_bar(), and if that is not present, prints the docstring of do_bar(), if available. With no argument, do_help() lists all available help topics (that is, all commands with corresponding help_*() methods or commands that have docstrings), and also lists any undocumented commands.
Cmd.cmdqueue  
A list of queued input lines. The cmdqueue list is checked in cmdloop() when new input is needed; if it is nonempty, its elements will be processed in order, as if entered at the prompt.
Cmd.completedefault(text, line, begidx, endidx)  
Method called to complete an input line when no command-specific complete_*() method is available. By default, it returns an empty list.
Cmd.default(line)  
Method called on an input line when the command prefix is not recognized. If this method is not overridden, it prints an error message and returns.
Cmd.doc_header  
The header to issue if the help output has a section for documented commands.
Cmd.emptyline()  
Method called when an empty line is entered in response to the prompt. If this method is not overridden, it repeats the last nonempty command entered.
Cmd.intro  
A string to issue as an intro or banner. May be overridden by giving the cmdloop() method an argument.
Cmd.misc_header  
The header to issue if the help output has a section for miscellaneous help topics (that is, there are help_*() methods without corresponding do_*() methods).
Cmd.onecmd(str)  
Interpret the argument as though it had been typed in response to the prompt. This may be overridden, but should not normally need to be; see the precmd() and postcmd() methods for useful execution hooks. The return value is a flag indicating whether interpretation of commands by the interpreter should stop. If there is a do_*() method for the command str, the return value of that method is returned, otherwise the return value from the default() method is returned.
Cmd.postcmd(stop, line)  
Hook method executed just after a command dispatch is finished. This method is a stub in Cmd; it exists to be overridden by subclasses. line is the command line which was executed, and stop is a flag which indicates whether execution will be terminated after the call to postcmd(); this will be the return value of the onecmd() method. The return value of this method will be used as the new value for the internal flag which corresponds to stop; returning false will cause interpretation to continue.
Cmd.postloop()  
Hook method executed once when cmdloop() is about to return. This method is a stub in Cmd; it exists to be overridden by subclasses.
Cmd.precmd(line)  
Hook method executed just before the command line line is interpreted, but after the input prompt is generated and issued. This method is a stub in Cmd; it exists to be overridden by subclasses. The return value is used as the command which will be executed by the onecmd() method; the precmd() implementation may re-write the command or simply return line unchanged.
Cmd.preloop()  
Hook method executed once when cmdloop() is called. This method is a stub in Cmd; it exists to be overridden by subclasses.
Cmd.ruler  
The character used to draw separator lines under the help-message headers. If empty, no ruler line is drawn. It defaults to '='.
Cmd.undoc_header  
The header to issue if the help output has a section for undocumented commands (that is, there are do_*() methods without corresponding help_*() methods).
Cmd.use_rawinput  
A flag, defaulting to true. If true, cmdloop() uses input() to display a prompt and read the next command; if false, sys.stdout.write() and sys.stdin.readline() are used. (This means that by importing readline, on systems that support it, the interpreter will automatically support Emacs-like line editing and command-history keystrokes.)
code.compile_command(source, filename="<input>", symbol="single")  
This function is useful for programs that want to emulate Python’s interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is to determine when the user has entered an incomplete command that can be completed by entering more text (as opposed to a complete command or a syntax error). This function almost always makes the same decision as the real interpreter main loop. source is the source string; filename is the optional filename from which source was read, defaulting to '<input>'; and symbol is the optional grammar start symbol, which should be 'single' (the default), 'eval' or 'exec'. Returns a code object (the same as compile(source, filename, symbol)) if the command is complete and valid; None if the command is incomplete; raises SyntaxError if the command is complete and contains a syntax error, or raises OverflowError or ValueError if the command contains an invalid literal.
code.interact(banner=None, readfunc=None, local=None, exitmsg=None)  
Convenience function to run a read-eval-print loop. This creates a new instance of InteractiveConsole and sets readfunc to be used as the InteractiveConsole.raw_input() method, if provided. If local is provided, it is passed to the InteractiveConsole constructor for use as the default namespace for the interpreter loop. The interact() method of the instance is then run with banner and exitmsg passed as the banner and exit message to use, if provided. The console object is discarded after use.  Changed in version 3.6: Added exitmsg parameter.
class code.InteractiveConsole(locals=None, filename="<console>")  
Closely emulate the behavior of the interactive Python interpreter. This class builds on InteractiveInterpreter and adds prompting using the familiar sys.ps1 and sys.ps2, and input buffering.
InteractiveConsole.interact(banner=None, exitmsg=None)  
Closely emulate the interactive Python console. The optional banner argument specify the banner to print before the first interaction; by default it prints a banner similar to the one printed by the standard Python interpreter, followed by the class name of the console object in parentheses (so as not to confuse this with the real interpreter – since it’s so close!). The optional exitmsg argument specifies an exit message printed when exiting. Pass the empty string to suppress the exit message. If exitmsg is not given or None, a default message is printed.  Changed in version 3.4: To suppress printing any banner, pass an empty string.   Changed in version 3.6: Print an exit message when exiting.
InteractiveConsole.push(line)  
Push a line of source text to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter’s runsource() method is called with the concatenated contents of the buffer as source. If this indicates that the command was executed or invalid, the buffer is reset; otherwise, the command is incomplete, and the buffer is left as it was after the line was appended. The return value is True if more input is required, False if the line was dealt with in some way (this is the same as runsource()).
InteractiveConsole.raw_input(prompt="")  
Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, EOFError is raised. The base implementation reads from sys.stdin; a subclass may replace this with a different implementation.
InteractiveConsole.resetbuffer()  
Remove any unhandled source text from the input buffer.
class code.InteractiveInterpreter(locals=None)  
This class deals with parsing and interpreter state (the user’s namespace); it does not deal with input buffering or prompting or input file naming (the filename is always passed in explicitly). The optional locals argument specifies the dictionary in which code will be executed; it defaults to a newly created dictionary with key '__name__' set to '__console__' and key '__doc__' set to None.
InteractiveInterpreter.runcode(code)  
Execute a code object. When an exception occurs, showtraceback() is called to display a traceback. All exceptions are caught except SystemExit, which is allowed to propagate. A note about KeyboardInterrupt: this exception may occur elsewhere in this code, and may not always be caught. The caller should be prepared to deal with it.
InteractiveInterpreter.runsource(source, filename="<input>", symbol="single")  
Compile and run some source in the interpreter. Arguments are the same as for compile_command(); the default for filename is '<input>', and for symbol is 'single'. One of several things can happen:  The input is incorrect; compile_command() raised an exception (SyntaxError or OverflowError). A syntax traceback will be printed by calling the showsyntaxerror() method. runsource() returns False. The input is incomplete, and more input is required; compile_command() returned None. runsource() returns True. The input is complete; compile_command() returned a code object. The code is executed by calling the runcode() (which also handles run-time exceptions, except for SystemExit). runsource() returns False.  The return value can be used to decide whether to use sys.ps1 or sys.ps2 to prompt the next line.
InteractiveInterpreter.showsyntaxerror(filename=None)  
Display the syntax error that just occurred. This does not display a stack trace because there isn’t one for syntax errors. If filename is given, it is stuffed into the exception instead of the default filename provided by Python’s parser, because it always uses '<string>' when reading from a string. The output is written by the write() method.
InteractiveInterpreter.showtraceback()  
Display the exception that just occurred. We remove the first stack item because it is within the interpreter object implementation. The output is written by the write() method.  Changed in version 3.5: The full chained traceback is displayed instead of just the primary traceback.
InteractiveInterpreter.write(data)  
Write a string to the standard error stream (sys.stderr). Derived classes should override this to provide the appropriate output handling as needed.
codecs.backslashreplace_errors(exception)  
Implements the 'backslashreplace' error handling (for text encodings only): malformed data is replaced by a backslashed escape sequence.
codecs.BOM  
codecs.BOM_BE  
codecs.BOM_LE  
codecs.BOM_UTF8  
codecs.BOM_UTF16  
codecs.BOM_UTF16_BE  
codecs.BOM_UTF16_LE  
codecs.BOM_UTF32  
codecs.BOM_UTF32_BE  
codecs.BOM_UTF32_LE  
These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data streams to indicate the byte order used, and in UTF-8 as a Unicode signature. BOM_UTF16 is either BOM_UTF16_BE or BOM_UTF16_LE depending on the platform’s native byte order, BOM is an alias for BOM_UTF16, BOM_LE for BOM_UTF16_LE and BOM_BE for BOM_UTF16_BE. The others represent the BOM in UTF-8 and UTF-32 encodings.
Codec.decode(input[, errors])  
Decodes the object input and returns a tuple (output object, length consumed). For instance, for a text encoding, decoding converts a bytes object encoded using a particular character set encoding to a string object. For text encodings and bytes-to-bytes codecs, input must be a bytes object or one which provides the read-only buffer interface – for example, buffer objects and memory mapped files. The errors argument defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamReader for codecs which have to keep state in order to make decoding efficient. The decoder must be able to handle zero length input and return an empty object of the output object type in this situation.
Codec.encode(input[, errors])  
Encodes the object input and returns a tuple (output object, length consumed). For instance, text encoding converts a string object to a bytes object using a particular character set encoding (e.g., cp1252 or iso-8859-1). The errors argument defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamWriter for codecs which have to keep state in order to make encoding efficient. The encoder must be able to handle zero length input and return an empty object of the output object type in this situation.
class codecs.CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None)  
Codec details when looking up the codec registry. The constructor arguments are stored in attributes of the same name:  
name  
The name of the encoding. 
  
encode  
decode  
The stateless encoding and decoding functions. These must be functions or methods which have the same interface as the encode() and decode() methods of Codec instances (see Codec Interface). The functions or methods are expected to work in a stateless mode. 
  
incrementalencoder  
incrementaldecoder  
Incremental encoder and decoder classes or factory functions. These have to provide the interface defined by the base classes IncrementalEncoder and IncrementalDecoder, respectively. Incremental codecs can maintain state. 
  
streamwriter  
streamreader  
Stream writer and reader classes or factory functions. These have to provide the interface defined by the base classes StreamWriter and StreamReader, respectively. Stream codecs can maintain state.
encode  
decode  
The stateless encoding and decoding functions. These must be functions or methods which have the same interface as the encode() and decode() methods of Codec instances (see Codec Interface). The functions or methods are expected to work in a stateless mode.
incrementalencoder  
incrementaldecoder  
Incremental encoder and decoder classes or factory functions. These have to provide the interface defined by the base classes IncrementalEncoder and IncrementalDecoder, respectively. Incremental codecs can maintain state.
streamwriter  
streamreader  
Stream writer and reader classes or factory functions. These have to provide the interface defined by the base classes StreamWriter and StreamReader, respectively. Stream codecs can maintain state.
codecs.decode(obj, encoding='utf-8', errors='strict')  
Decodes obj using the codec registered for encoding. Errors may be given to set the desired error handling scheme. The default error handler is 'strict' meaning that decoding errors raise ValueError (or a more codec specific subclass, such as UnicodeDecodeError). Refer to Codec Base Classes for more information on codec error handling.
codecs.encode(obj, encoding='utf-8', errors='strict')  
Encodes obj using the codec registered for encoding. Errors may be given to set the desired error handling scheme. The default error handler is 'strict' meaning that encoding errors raise ValueError (or a more codec specific subclass, such as UnicodeEncodeError). Refer to Codec Base Classes for more information on codec error handling.
codecs.EncodedFile(file, data_encoding, file_encoding=None, errors='strict')  
Return a StreamRecoder instance, a wrapped version of file which provides transparent transcoding. The original file is closed when the wrapped version is closed. Data written to the wrapped file is decoded according to the given data_encoding and then written to the original file as bytes using file_encoding. Bytes read from the original file are decoded according to file_encoding, and the result is encoded using data_encoding. If file_encoding is not given, it defaults to data_encoding. errors may be given to define the error handling. It defaults to 'strict', which causes ValueError to be raised in case an encoding error occurs.
codecs.getdecoder(encoding)  
Look up the codec for the given encoding and return its decoder function. Raises a LookupError in case the encoding cannot be found.
codecs.getencoder(encoding)  
Look up the codec for the given encoding and return its encoder function. Raises a LookupError in case the encoding cannot be found.
codecs.getincrementaldecoder(encoding)  
Look up the codec for the given encoding and return its incremental decoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codec doesn’t support an incremental decoder.
codecs.getincrementalencoder(encoding)  
Look up the codec for the given encoding and return its incremental encoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codec doesn’t support an incremental encoder.
codecs.getreader(encoding)  
Look up the codec for the given encoding and return its StreamReader class or factory function. Raises a LookupError in case the encoding cannot be found.
codecs.getwriter(encoding)  
Look up the codec for the given encoding and return its StreamWriter class or factory function. Raises a LookupError in case the encoding cannot be found.
codecs.ignore_errors(exception)  
Implements the 'ignore' error handling: malformed data is ignored and encoding or decoding is continued without further notice.