neulab/docprompting-conala huggingface dataset:
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.
threading.main_thread()  
Return the main Thread object. In normal conditions, the main thread is the thread from which the Python interpreter was started.  New in version 3.4.
class threading.RLock  
This class implements reentrant lock objects. A reentrant lock must be released by the thread that acquired it. Once a thread has acquired a reentrant lock, the same thread may acquire it again without blocking; the thread must release it once for each time it has acquired it. Note that RLock is actually a factory function which returns an instance of the most efficient version of the concrete RLock class that is supported by the platform.  
acquire(blocking=True, timeout=-1)  
Acquire a lock, blocking or non-blocking. When invoked without arguments: if this thread already owns the lock, increment the recursion level by one, and return immediately. Otherwise, if another thread owns the lock, block until the lock is unlocked. Once the lock is unlocked (not owned by any thread), then grab ownership, set the recursion level to one, and return. If more than one thread is blocked waiting until the lock is unlocked, only one at a time will be able to grab ownership of the lock. There is no return value in this case. When invoked with the blocking argument set to true, do the same thing as when called without arguments, and return True. When invoked with the blocking argument set to false, do not block. If a call without an argument would block, return False immediately; otherwise, do the same thing as when called without arguments, 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. Return True if the lock has been acquired, false if the timeout has elapsed.  Changed in version 3.2: The timeout parameter is new.  
  
release()  
Release a lock, decrementing the recursion level. If after the decrement it is zero, reset the lock to unlocked (not owned by any thread), and if any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. If after the decrement the recursion level is still nonzero, the lock remains locked and owned by the calling thread. Only call this method when the calling thread owns the lock. A RuntimeError is raised if this method is called when the lock is unlocked. There is no return value.
acquire(blocking=True, timeout=-1)  
Acquire a lock, blocking or non-blocking. When invoked without arguments: if this thread already owns the lock, increment the recursion level by one, and return immediately. Otherwise, if another thread owns the lock, block until the lock is unlocked. Once the lock is unlocked (not owned by any thread), then grab ownership, set the recursion level to one, and return. If more than one thread is blocked waiting until the lock is unlocked, only one at a time will be able to grab ownership of the lock. There is no return value in this case. When invoked with the blocking argument set to true, do the same thing as when called without arguments, and return True. When invoked with the blocking argument set to false, do not block. If a call without an argument would block, return False immediately; otherwise, do the same thing as when called without arguments, 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. Return True if the lock has been acquired, false if the timeout has elapsed.  Changed in version 3.2: The timeout parameter is new.
release()  
Release a lock, decrementing the recursion level. If after the decrement it is zero, reset the lock to unlocked (not owned by any thread), and if any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. If after the decrement the recursion level is still nonzero, the lock remains locked and owned by the calling thread. Only call this method when the calling thread owns the lock. A RuntimeError is raised if this method is called when the lock is unlocked. There is no return value.
class threading.Semaphore(value=1)  
This class implements semaphore objects. A semaphore manages an atomic counter representing the number of release() calls minus the number of acquire() calls, plus an initial value. The acquire() method blocks if necessary until it can return without making the counter negative. If not given, value defaults to 1. The optional argument gives the initial value for the internal counter; it defaults to 1. If the value given is less than 0, ValueError is raised.  Changed in version 3.3: changed from a factory function to a class.   
acquire(blocking=True, timeout=None)  
Acquire a semaphore. When invoked without arguments:  If the internal counter is larger than zero on entry, decrement it by one and return True immediately. If the internal counter is zero on entry, block until awoken by a call to release(). Once awoken (and the counter is greater than 0), decrement the counter by 1 and return True. Exactly one thread will be awoken by each call to release(). The order in which threads are awoken should not be relied on.  When invoked with blocking set to false, do not block. If a call without an argument would block, return False immediately; otherwise, do the same thing as when called without arguments, and return True. When invoked with a timeout other than None, it will block for at most timeout seconds. If acquire does not complete successfully in that interval, return False. Return True otherwise.  Changed in version 3.2: The timeout parameter is new.  
  
release(n=1)  
Release a semaphore, incrementing the internal counter by n. When it was zero on entry and other threads are waiting for it to become larger than zero again, wake up n of those threads.  Changed in version 3.9: Added the n parameter to release multiple waiting threads at once.
acquire(blocking=True, timeout=None)  
Acquire a semaphore. When invoked without arguments:  If the internal counter is larger than zero on entry, decrement it by one and return True immediately. If the internal counter is zero on entry, block until awoken by a call to release(). Once awoken (and the counter is greater than 0), decrement the counter by 1 and return True. Exactly one thread will be awoken by each call to release(). The order in which threads are awoken should not be relied on.  When invoked with blocking set to false, do not block. If a call without an argument would block, return False immediately; otherwise, do the same thing as when called without arguments, and return True. When invoked with a timeout other than None, it will block for at most timeout seconds. If acquire does not complete successfully in that interval, return False. Return True otherwise.  Changed in version 3.2: The timeout parameter is new.
release(n=1)  
Release a semaphore, incrementing the internal counter by n. When it was zero on entry and other threads are waiting for it to become larger than zero again, wake up n of those threads.  Changed in version 3.9: Added the n parameter to release multiple waiting threads at once.
threading.setprofile(func)  
Set a profile function for all threads started from the threading module. The func will be passed to sys.setprofile() for each thread, before its run() method is called.
threading.settrace(func)  
Set a trace function for all threads started from the threading module. The func will be passed to sys.settrace() for each thread, before its run() method is called.
threading.stack_size([size])  
Return the thread stack size used when creating new threads. The optional size argument specifies the stack size to be used for subsequently created threads, and must be 0 (use platform or configured default) or a positive integer value of at least 32,768 (32 KiB). If size is not specified, 0 is used. If changing the thread stack size is unsupported, a RuntimeError is raised. If the specified stack size is invalid, a ValueError is raised and the stack size is unmodified. 32 KiB is currently the minimum supported stack size value to guarantee sufficient stack space for the interpreter itself. Note that some platforms may have particular restrictions on values for the stack size, such as requiring a minimum stack size > 32 KiB or requiring allocation in multiples of the system memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information). Availability: Windows, systems with POSIX threads.
daemon  
A boolean value indicating whether this thread is a daemon thread (True) or not (False). This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False. The entire Python program exits when no alive non-daemon threads are left.
getName()  
setName()  
Old getter/setter API for name; use it directly as a property instead.
ident  
The ‘thread identifier’ of this thread or None if the thread has not been started. This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
isDaemon()  
setDaemon()  
Old getter/setter API for daemon; use it directly as a property instead.
is_alive()  
Return whether the thread is alive. This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.
join(timeout=None)  
Wait until the thread terminates. This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception – 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). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out. When the timeout argument is not present or None, the operation will block until the thread terminates. A thread can be join()ed many times. join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raise the same exception.
name  
A string used for identification purposes only. It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
native_id  
The native integral thread ID of this thread. This is a non-negative integer, or None if the thread has not been started. See the get_native_id() function. This represents the Thread ID (TID) as assigned to the thread by the OS (kernel). 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).  Note Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-wide) from the time the thread is created until the thread has been terminated.  Availability: Requires get_native_id() function.  New in version 3.8.
run()  
Method representing the thread’s activity. You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with positional and keyword arguments taken from the args and kwargs arguments, respectively.
start()  
Start the thread’s activity. It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control. This method will raise a RuntimeError if called more than once on the same thread object.
threading.TIMEOUT_MAX  
The maximum value allowed for the timeout parameter of blocking functions (Lock.acquire(), RLock.acquire(), Condition.wait(), etc.). Specifying a timeout greater than this value will raise an OverflowError.  New in version 3.2.
class threading.Timer(interval, function, args=None, kwargs=None)  
Create a timer that will run function with arguments args and keyword arguments kwargs, after interval seconds have passed. If args is None (the default) then an empty list will be used. If kwargs is None (the default) then an empty dict will be used.  Changed in version 3.3: changed from a factory function to a class.   
cancel()  
Stop the timer, and cancel the execution of the timer’s action. This will only work if the timer is still in its waiting stage.
cancel()  
Stop the timer, and cancel the execution of the timer’s action. This will only work if the timer is still in its waiting stage.
time.altzone  
The offset of the local DST timezone, in seconds west of UTC, if one is defined. This is negative if the local DST timezone is east of UTC (as in Western Europe, including the UK). Only use this if daylight is nonzero. See note below.
time.asctime([t])  
Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a string of the following form: 'Sun Jun 20 23:21:05 1993'. The day field is two characters long and is space padded if the day is a single digit, e.g.: 'Wed Jun  9 04:26:40 1993'. If t is not provided, the current time as returned by localtime() is used. Locale information is not used by asctime().  Note Unlike the C function of the same name, asctime() does not add a trailing newline.
time.CLOCK_BOOTTIME  
Identical to CLOCK_MONOTONIC, except it also includes any time that the system is suspended. This allows applications to get a suspend-aware monotonic clock without having to deal with the complications of CLOCK_REALTIME, which may have discontinuities if the time is changed using settimeofday() or similar. Availability: Linux 2.6.39 or later.  New in version 3.7.
time.clock_getres(clk_id)  
Return the resolution (precision) of the specified clock clk_id. Refer to Clock ID Constants for a list of accepted values for clk_id. Availability: Unix.  New in version 3.3.
time.clock_gettime(clk_id) → float  
Return the time of the specified clock clk_id. Refer to Clock ID Constants for a list of accepted values for clk_id. Availability: Unix.  New in version 3.3.
time.clock_gettime_ns(clk_id) → int  
Similar to clock_gettime() but return time as nanoseconds. Availability: Unix.  New in version 3.7.
time.CLOCK_HIGHRES  
The Solaris OS has a CLOCK_HIGHRES timer that attempts to use an optimal hardware source, and may give close to nanosecond resolution. CLOCK_HIGHRES is the nonadjustable, high-resolution clock. Availability: Solaris.  New in version 3.3.
time.CLOCK_MONOTONIC  
Clock that cannot be set and represents monotonic time since some unspecified starting point. Availability: Unix.  New in version 3.3.
time.CLOCK_MONOTONIC_RAW  
Similar to CLOCK_MONOTONIC, but provides access to a raw hardware-based time that is not subject to NTP adjustments. Availability: Linux 2.6.28 and newer, macOS 10.12 and newer.  New in version 3.3.
time.CLOCK_PROCESS_CPUTIME_ID  
High-resolution per-process timer from the CPU. Availability: Unix.  New in version 3.3.
time.CLOCK_PROF  
High-resolution per-process timer from the CPU. Availability: FreeBSD, NetBSD 7 or later, OpenBSD.  New in version 3.7.
time.CLOCK_REALTIME  
System-wide real-time clock. Setting this clock requires appropriate privileges. Availability: Unix.  New in version 3.3.
time.clock_settime(clk_id, time: float)  
Set the time of the specified clock clk_id. Currently, CLOCK_REALTIME is the only accepted value for clk_id. Availability: Unix.  New in version 3.3.
time.clock_settime_ns(clk_id, time: int)  
Similar to clock_settime() but set time with nanoseconds. Availability: Unix.  New in version 3.7.
time.CLOCK_TAI  
International Atomic Time The system must have a current leap second table in order for this to give the correct answer. PTP or NTP software can maintain a leap second table. Availability: Linux.  New in version 3.9.
time.CLOCK_THREAD_CPUTIME_ID  
Thread-specific CPU-time clock. Availability: Unix.  New in version 3.3.
time.CLOCK_UPTIME  
Time whose absolute value is the time the system has been running and not suspended, providing accurate uptime measurement, both absolute and interval. Availability: FreeBSD, OpenBSD 5.5 or later.  New in version 3.7.
time.CLOCK_UPTIME_RAW  
Clock that increments monotonically, tracking the time since an arbitrary point, unaffected by frequency or time adjustments and not incremented while the system is asleep. Availability: macOS 10.12 and newer.  New in version 3.8.
time.ctime([secs])  
Convert a time expressed in seconds since the epoch to a string of a form: 'Sun Jun 20 23:21:05 1993' representing local time. The day field is two characters long and is space padded if the day is a single digit, e.g.: 'Wed Jun  9 04:26:40 1993'. If secs is not provided or None, the current time as returned by time() is used. ctime(secs) is equivalent to asctime(localtime(secs)). Locale information is not used by ctime().
time.daylight  
Nonzero if a DST timezone is defined. See note below.
time.get_clock_info(name)  
Get information on the specified clock as a namespace object. Supported clock names and the corresponding functions to read their value are:  
'monotonic': time.monotonic()
 
'perf_counter': time.perf_counter()
 
'process_time': time.process_time()
 
'thread_time': time.thread_time()
 
'time': time.time()
  The result has the following attributes:  
adjustable: True if the clock can be changed automatically (e.g. by a NTP daemon) or manually by the system administrator, False otherwise 
implementation: The name of the underlying C function used to get the clock value. Refer to Clock ID Constants for possible values. 
monotonic: True if the clock cannot go backward, False otherwise 
resolution: The resolution of the clock in seconds (float)   New in version 3.3.
time.gmtime([secs])  
Convert a time expressed in seconds since the epoch to a struct_time in UTC in which the dst flag is always zero. If secs is not provided or None, the current time as returned by time() is used. Fractions of a second are ignored. See above for a description of the struct_time object. See calendar.timegm() for the inverse of this function.
time.localtime([secs])  
Like gmtime() but converts to local time. If secs is not provided or None, the current time as returned by time() is used. The dst flag is set to 1 when DST applies to the given time.
time.mktime(t)  
This is the inverse function of localtime(). Its argument is the struct_time or full 9-tuple (since the dst flag is needed; use -1 as the dst flag if it is unknown) which expresses the time in local time, not UTC. It returns a floating point number, for compatibility with time(). If the input value cannot be represented as a valid time, either OverflowError or ValueError will be raised (which depends on whether the invalid value is caught by Python or the underlying C libraries). The earliest date for which it can generate a time is platform-dependent.
time.monotonic() → float  
Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.  New in version 3.3.   Changed in version 3.5: The function is now always available and always system-wide.
time.monotonic_ns() → int  
Similar to monotonic(), but return time as nanoseconds.  New in version 3.7.
time.perf_counter() → float  
Return the value (in fractional seconds) of a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.  New in version 3.3.
time.perf_counter_ns() → int  
Similar to perf_counter(), but return time as nanoseconds.  New in version 3.7.
time.process_time() → float  
Return the value (in fractional seconds) of the sum of the system and user CPU time of the current process. It does not include time elapsed during sleep. It is process-wide by definition. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.  New in version 3.3.
time.process_time_ns() → int  
Similar to process_time() but return time as nanoseconds.  New in version 3.7.
time.pthread_getcpuclockid(thread_id)  
Return the clk_id of the thread-specific CPU-time clock for the specified thread_id. Use threading.get_ident() or the ident attribute of threading.Thread objects to get a suitable value for thread_id.  Warning Passing an invalid or expired thread_id may result in undefined behavior, such as segmentation fault.  Availability: Unix (see the man page for pthread_getcpuclockid(3) for further information).  New in version 3.7.
time.sleep(secs)  
Suspend execution of the calling thread for the given number of seconds. The argument may be a floating point number to indicate a more precise sleep time. The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine. Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system.  Changed in version 3.5: The function now sleeps at least secs even if the sleep is interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale).