neulab/docprompting-conala huggingface dataset:
test.support.TESTFN_UNDECODABLE  
Set to a filename (bytes type) that should not be able to be decoded by file system encoding in strict mode. It may be None if it’s not possible to generate such a filename.
test.support.TESTFN_UNENCODABLE  
Set to a filename (str type) that should not be able to be encoded by file system encoding in strict mode. It may be None if it’s not possible to generate such a filename.
test.support.TESTFN_UNICODE  
Set to a non-ASCII name for a temporary file.
test.support.TEST_DATA_DIR  
Set to the data directory within the test package.
test.support.TEST_HOME_DIR  
Set to the top level directory for the test package.
test.support.TEST_HTTP_URL  
Define the URL of a dedicated HTTP server for the network tests.
test.support.TEST_SUPPORT_DIR  
Set to the top level directory that contains test.support.
test.support.threading_cleanup(*original_values)  
Cleanup up threads not specified in original_values. Designed to emit a warning if a test leaves running threads in the background.
test.support.threading_setup()  
Return current thread count and copy of dangling threads.
class test.support.TransientResource(exc, **kwargs)  
Instances are a context manager that raises ResourceDenied if the specified exception type is raised. Any keyword arguments are treated as attribute/value pairs to be compared against any exception raised within the with statement. Only if all pairs match properly against attributes on the exception is ResourceDenied raised.
test.support.unlink(filename)  
Call os.unlink() on filename. On Windows platforms, this is wrapped with a wait loop that checks for the existence fo the file.
test.support.verbose  
True when verbose output is enabled. Should be checked when more detailed information is desired about a running test. verbose is set by test.regrtest.
test.support.wait_process(pid, *, exitcode, timeout=None)  
Wait until process pid completes and check that the process exit code is exitcode. Raise an AssertionError if the process exit code is not equal to exitcode. If the process runs longer than timeout seconds (SHORT_TIMEOUT by default), kill the process and raise an AssertionError. The timeout feature is not available on Windows.  New in version 3.9.
test.support.wait_threads_exit(timeout=60.0)  
Context manager to wait until all threads created in the with statement exit.
class test.support.WarningsRecorder  
Class used to record warnings for unit tests. See documentation of check_warnings() above for more details.
test.support.with_pymalloc()  
Return _testcapi.WITH_PYMALLOC.
textwrap.dedent(text)  
Remove any common leading whitespace from every line in text. This can be used to make triple-quoted strings line up with the left edge of the display, while still presenting them in the source code in indented form. Note that tabs and spaces are both treated as whitespace, but they are not equal: the lines "  hello" and "\thello" are considered to have no common leading whitespace. Lines containing only whitespace are ignored in the input and normalized to a single newline character in the output. For example: def test():
    # end first line with \ to avoid the empty line!
    s = '''\
    hello
      world
    '''
    print(repr(s))          # prints '    hello\n      world\n    '
    print(repr(dedent(s)))  # prints 'hello\n  world\n'
textwrap.fill(text, width=70, **kwargs)  
Wraps the single paragraph in text, and returns a single string containing the wrapped paragraph. fill() is shorthand for "\n".join(wrap(text, ...))
 In particular, fill() accepts exactly the same keyword arguments as wrap().
textwrap.indent(text, prefix, predicate=None)  
Add prefix to the beginning of selected lines in text. Lines are separated by calling text.splitlines(True). By default, prefix is added to all lines that do not consist solely of whitespace (including any line endings). For example: >>> s = 'hello\n\n \nworld'
>>> indent(s, '  ')
'  hello\n\n \n  world'
 The optional predicate argument can be used to control which lines are indented. For example, it is easy to add prefix to even empty and whitespace-only lines: >>> print(indent(s, '+ ', lambda line: True))
+ hello
+
+
+ world
  New in version 3.3.
textwrap.shorten(text, width, **kwargs)  
Collapse and truncate the given text to fit in the given width. First the whitespace in text is collapsed (all whitespace is replaced by single spaces). If the result fits in the width, it is returned. Otherwise, enough words are dropped from the end so that the remaining words plus the placeholder fit within width: >>> textwrap.shorten("Hello  world!", width=12)
'Hello world!'
>>> textwrap.shorten("Hello  world!", width=11)
'Hello [...]'
>>> textwrap.shorten("Hello world", width=10, placeholder="...")
'Hello...'
 Optional keyword arguments correspond to the instance attributes of TextWrapper, documented below. Note that the whitespace is collapsed before the text is passed to the TextWrapper fill() function, so changing the value of tabsize, expand_tabs, drop_whitespace, and replace_whitespace will have no effect.  New in version 3.4.
break_long_words  
(default: True) If true, then words longer than width will be broken in order to ensure that no lines are longer than width. If it is false, long words will not be broken, and some lines may be longer than width. (Long words will be put on a line by themselves, in order to minimize the amount by which width is exceeded.)
break_on_hyphens  
(default: True) If true, wrapping will occur preferably on whitespaces and right after hyphens in compound words, as it is customary in English. If false, only whitespaces will be considered as potentially good places for line breaks, but you need to set break_long_words to false if you want truly insecable words. Default behaviour in previous versions was to always allow breaking hyphenated words.
drop_whitespace  
(default: True) If true, whitespace at the beginning and ending of every line (after wrapping but before indenting) is dropped. Whitespace at the beginning of the paragraph, however, is not dropped if non-whitespace follows it. If whitespace being dropped takes up an entire line, the whole line is dropped.
expand_tabs  
(default: True) If true, then all tab characters in text will be expanded to spaces using the expandtabs() method of text.
fill(text)  
Wraps the single paragraph in text, and returns a single string containing the wrapped paragraph.
fix_sentence_endings  
(default: False) If true, TextWrapper attempts to detect sentence endings and ensure that sentences are always separated by exactly two spaces. This is generally desired for text in a monospaced font. However, the sentence detection algorithm is imperfect: it assumes that a sentence ending consists of a lowercase letter followed by one of '.', '!', or '?', possibly followed by one of '"' or "'", followed by a space. One problem with this is algorithm is that it is unable to detect the difference between “Dr.” in [...] Dr. Frankenstein's monster [...]
 and “Spot.” in [...] See Spot. See Spot run [...]
 fix_sentence_endings is false by default. Since the sentence detection algorithm relies on string.lowercase for the definition of “lowercase letter”, and a convention of using two spaces after a period to separate sentences on the same line, it is specific to English-language texts.
initial_indent  
(default: '') String that will be prepended to the first line of wrapped output. Counts towards the length of the first line. The empty string is not indented.
max_lines  
(default: None) If not None, then the output will contain at most max_lines lines, with placeholder appearing at the end of the output.  New in version 3.4.
placeholder  
(default: ' [...]') String that will appear at the end of the output text if it has been truncated.  New in version 3.4.
replace_whitespace  
(default: True) If true, after tab expansion but before wrapping, the wrap() method will replace each whitespace character with a single space. The whitespace characters replaced are as follows: tab, newline, vertical tab, formfeed, and carriage return ('\t\n\v\f\r').  Note If expand_tabs is false and replace_whitespace is true, each tab character will be replaced by a single space, which is not the same as tab expansion.   Note If replace_whitespace is false, newlines may appear in the middle of a line and cause strange output. For this reason, text should be split into paragraphs (using str.splitlines() or similar) which are wrapped separately.
subsequent_indent  
(default: '') String that will be prepended to all lines of wrapped output except the first. Counts towards the length of each line except the first.
tabsize  
(default: 8) If expand_tabs is true, then all tab characters in text will be expanded to zero or more spaces, depending on the current column and the given tab size.  New in version 3.3.
width  
(default: 70) The maximum length of wrapped lines. As long as there are no individual words in the input text longer than width, TextWrapper guarantees that no output line will be longer than width characters.
wrap(text)  
Wraps the single paragraph in text (a string) so every line is at most width characters long. All wrapping options are taken from instance attributes of the TextWrapper instance. Returns a list of output lines, without final newlines. If the wrapped output has no content, the returned list is empty.
textwrap.wrap(text, width=70, **kwargs)  
Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines, without final newlines. Optional keyword arguments correspond to the instance attributes of TextWrapper, documented below. width defaults to 70. See the TextWrapper.wrap() method for additional details on how wrap() behaves.
threading.active_count()  
Return the number of Thread objects currently alive. The returned count is equal to the length of the list returned by enumerate().
class threading.Barrier(parties, action=None, timeout=None)  
Create a barrier object for parties number of threads. An action, when provided, is a callable to be called by one of the threads when they are released. timeout is the default timeout value if none is specified for the wait() method.  
wait(timeout=None)  
Pass the barrier. When all the threads party to the barrier have called this function, they are all released simultaneously. If a timeout is provided, it is used in preference to any that was supplied to the class constructor. The return value is an integer in the range 0 to parties – 1, different for each thread. This can be used to select a thread to do some special housekeeping, e.g.: i = barrier.wait()
if i == 0:
    # Only one thread needs to print this
    print("passed the barrier")
 If an action was provided to the constructor, one of the threads will have called it prior to being released. Should this call raise an error, the barrier is put into the broken state. If the call times out, the barrier is put into the broken state. This method may raise a BrokenBarrierError exception if the barrier is broken or reset while a thread is waiting. 
  
reset()  
Return the barrier to the default, empty state. Any threads waiting on it will receive the BrokenBarrierError exception. Note that using this function may require some external synchronization if there are other threads whose state is unknown. If a barrier is broken it may be better to just leave it and create a new one. 
  
abort()  
Put the barrier into a broken state. This causes any active or future calls to wait() to fail with the BrokenBarrierError. Use this for example if one of the threads needs to abort, to avoid deadlocking the application. It may be preferable to simply create the barrier with a sensible timeout value to automatically guard against one of the threads going awry. 
  
parties  
The number of threads required to pass the barrier. 
  
n_waiting  
The number of threads currently waiting in the barrier. 
  
broken  
A boolean that is True if the barrier is in the broken state.
abort()  
Put the barrier into a broken state. This causes any active or future calls to wait() to fail with the BrokenBarrierError. Use this for example if one of the threads needs to abort, to avoid deadlocking the application. It may be preferable to simply create the barrier with a sensible timeout value to automatically guard against one of the threads going awry.
reset()  
Return the barrier to the default, empty state. Any threads waiting on it will receive the BrokenBarrierError exception. Note that using this function may require some external synchronization if there are other threads whose state is unknown. If a barrier is broken it may be better to just leave it and create a new one.
wait(timeout=None)  
Pass the barrier. When all the threads party to the barrier have called this function, they are all released simultaneously. If a timeout is provided, it is used in preference to any that was supplied to the class constructor. The return value is an integer in the range 0 to parties – 1, different for each thread. This can be used to select a thread to do some special housekeeping, e.g.: i = barrier.wait()
if i == 0:
    # Only one thread needs to print this
    print("passed the barrier")
 If an action was provided to the constructor, one of the threads will have called it prior to being released. Should this call raise an error, the barrier is put into the broken state. If the call times out, the barrier is put into the broken state. This method may raise a BrokenBarrierError exception if the barrier is broken or reset while a thread is waiting.
class threading.BoundedSemaphore(value=1)  
Class implementing bounded semaphore objects. A bounded semaphore checks to make sure its current value doesn’t exceed its initial value. If it does, ValueError is raised. In most situations semaphores are used to guard resources with limited capacity. If the semaphore is released too many times it’s a sign of a bug. If not given, value defaults to 1.  Changed in version 3.3: changed from a factory function to a class.
exception threading.BrokenBarrierError  
This exception, a subclass of RuntimeError, is raised when the Barrier object is reset or broken.
acquire(*args)  
Acquire the underlying lock. This method calls the corresponding method on the underlying lock; the return value is whatever that method returns.
notify(n=1)  
By default, wake up one thread waiting on this condition, if any. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. This method wakes up at most n of the threads waiting for the condition variable; it is a no-op if no threads are waiting. The current implementation wakes up exactly n threads, if at least n threads are waiting. However, it’s not safe to rely on this behavior. A future, optimized implementation may occasionally wake up more than n threads. Note: an awakened thread does not actually return from its wait() call until it can reacquire the lock. Since notify() does not release the lock, its caller should.
notify_all()  
Wake up all threads waiting on this condition. This method acts like notify(), but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.
release()  
Release the underlying lock. This method calls the corresponding method on the underlying lock; there is no return value.
wait(timeout=None)  
Wait until notified or until a timeout occurs. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. This method releases the underlying lock, and then blocks until it is awakened by a notify() or notify_all() call for the same condition variable in another thread, or until the optional timeout occurs. Once awakened or timed out, it re-acquires the lock and returns. When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). When the underlying lock is an RLock, it is not released using its release() method, since this may not actually unlock the lock when it was acquired multiple times recursively. Instead, an internal interface of the RLock class is used, which really unlocks it even when it has been recursively acquired several times. Another internal interface is then used to restore the recursion level when the lock is reacquired. The return value is True unless a given timeout expired, in which case it is False.  Changed in version 3.2: Previously, the method always returned None.
wait_for(predicate, timeout=None)  
Wait until a condition evaluates to true. predicate should be a callable which result will be interpreted as a boolean value. A timeout may be provided giving the maximum time to wait. This utility method may call wait() repeatedly until the predicate is satisfied, or until a timeout occurs. The return value is the last return value of the predicate and will evaluate to False if the method timed out. Ignoring the timeout feature, calling this method is roughly equivalent to writing: while not predicate():
    cv.wait()
 Therefore, the same rules apply as with wait(): The lock must be held when called and is re-acquired on return. The predicate is evaluated with the lock held.  New in version 3.2.
threading.current_thread()  
Return the current Thread object, corresponding to the caller’s thread of control. If the caller’s thread of control was not created through the threading module, a dummy thread object with limited functionality is returned.
threading.enumerate()  
Return a list of all Thread objects currently alive. The list includes daemonic threads, dummy thread objects created by current_thread(), and the main thread. It excludes terminated threads and threads that have not yet been started.
class threading.Event  
Class implementing event objects. An event manages a flag that can be set to true with the set() method and reset to false with the clear() method. The wait() method blocks until the flag is true. The flag is initially false.  Changed in version 3.3: changed from a factory function to a class.   
is_set()  
Return True if and only if the internal flag is true. 
  
set()  
Set the internal flag to true. All threads waiting for it to become true are awakened. Threads that call wait() once the flag is true will not block at all. 
  
clear()  
Reset the internal flag to false. Subsequently, threads calling wait() will block until set() is called to set the internal flag to true again. 
  
wait(timeout=None)  
Block until the internal flag is true. If the internal flag is true on entry, return immediately. Otherwise, block until another thread calls set() to set the flag to true, or until the optional timeout occurs. When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). This method returns True if and only if the internal flag has been set to true, either before the wait call or after the wait starts, so it will always return True except if a timeout is given and the operation times out.  Changed in version 3.1: Previously, the method always returned None.
clear()  
Reset the internal flag to false. Subsequently, threads calling wait() will block until set() is called to set the internal flag to true again.
set()  
Set the internal flag to true. All threads waiting for it to become true are awakened. Threads that call wait() once the flag is true will not block at all.
wait(timeout=None)  
Block until the internal flag is true. If the internal flag is true on entry, return immediately. Otherwise, block until another thread calls set() to set the flag to true, or until the optional timeout occurs. When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). This method returns True if and only if the internal flag has been set to true, either before the wait call or after the wait starts, so it will always return True except if a timeout is given and the operation times out.  Changed in version 3.1: Previously, the method always returned None.
threading.excepthook(args, /)  
Handle uncaught exception raised by Thread.run(). The args argument has the following attributes:  
exc_type: Exception type. 
exc_value: Exception value, can be None. 
exc_traceback: Exception traceback, can be None. 
thread: Thread which raised the exception, can be None.  If exc_type is SystemExit, the exception is silently ignored. Otherwise, the exception is printed out on sys.stderr. If this function raises an exception, sys.excepthook() is called to handle it. threading.excepthook() can be overridden to control how uncaught exceptions raised by Thread.run() are handled. Storing exc_value using a custom hook can create a reference cycle. It should be cleared explicitly to break the reference cycle when the exception is no longer needed. Storing thread using a custom hook can resurrect it if it is set to an object which is being finalized. Avoid storing thread after the custom hook completes to avoid resurrecting objects.  See also sys.excepthook() handles uncaught exceptions.   New in version 3.8.
threading.get_ident()  
Return the ‘thread identifier’ of the current thread. This is a nonzero integer. Its value has no direct meaning; it is intended as a magic cookie to be used e.g. to index a dictionary of thread-specific data. Thread identifiers may be recycled when a thread exits and another thread is created.  New in version 3.3.
threading.get_native_id()  
Return the native integral Thread ID of the current thread assigned by the kernel. This is a non-negative integer. Its value may be used to uniquely identify this particular thread system-wide (until the thread terminates, after which the value may be recycled by the OS). Availability: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX.  New in version 3.8.
class threading.local  
A class that represents thread-local data. For more details and extensive examples, see the documentation string of the _threading_local module.
class threading.Lock  
The class implementing primitive lock objects. Once a thread has acquired a lock, subsequent attempts to acquire it block, until it is released; any thread may release it. Note that Lock is actually a factory function which returns an instance of the most efficient version of the concrete Lock class that is supported by the platform.  
acquire(blocking=True, timeout=-1)  
Acquire a lock, blocking or non-blocking. When invoked with the blocking argument set to True (the default), block until the lock is unlocked, then set it to locked and return True. When invoked with the blocking argument set to False, do not block. If a call with blocking set to True would block, return False immediately; otherwise, set the lock to locked and return True. When invoked with the floating-point timeout argument set to a positive value, block for at most the number of seconds specified by timeout and as long as the lock cannot be acquired. A timeout argument of -1 specifies an unbounded wait. It is forbidden to specify a timeout when blocking is false. The return value is True if the lock is acquired successfully, False if not (for example if the timeout expired).  Changed in version 3.2: The timeout parameter is new.   Changed in version 3.2: Lock acquisition can now be interrupted by signals on POSIX if the underlying threading implementation supports it.  
  
release()  
Release a lock. This can be called from any thread, not only the thread which has acquired the lock. When the lock is locked, reset it to unlocked, and return. If any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. When invoked on an unlocked lock, a RuntimeError is raised. There is no return value. 
  
locked()  
Return true if the lock is acquired.