neulab/docprompting-conala huggingface dataset:
attach_loop(loop)  
Attach the watcher to an event loop. If the watcher was previously attached to an event loop, then it is first detached before attaching to the new loop. Note: loop may be None.
close()  
Close the watcher. This method has to be called to ensure that underlying resources are cleaned-up.
is_active()  
Return True if the watcher is ready to use. Spawning a subprocess with inactive current child watcher raises RuntimeError.  New in version 3.8.
remove_child_handler(pid)  
Removes the handler for process with PID equal to pid. The function returns True if the handler was successfully removed, False if there was nothing to remove.
class asyncio.AbstractEventLoop  
Abstract base class for asyncio-compliant event loops. The Event Loop Methods section lists all methods that an alternative implementation of AbstractEventLoop should have defined.
class asyncio.AbstractEventLoopPolicy  
An abstract base class for asyncio policies.  
get_event_loop()  
Get the event loop for the current context. Return an event loop object implementing the AbstractEventLoop interface. This method should never return None.  Changed in version 3.6.  
  
set_event_loop(loop)  
Set the event loop for the current context to loop. 
  
new_event_loop()  
Create and return a new event loop object. This method should never return None. 
  
get_child_watcher()  
Get a child process watcher object. Return a watcher object implementing the AbstractChildWatcher interface. This function is Unix specific. 
  
set_child_watcher(watcher)  
Set the current child process watcher to watcher. This function is Unix specific.
get_child_watcher()  
Get a child process watcher object. Return a watcher object implementing the AbstractChildWatcher interface. This function is Unix specific.
get_event_loop()  
Get the event loop for the current context. Return an event loop object implementing the AbstractEventLoop interface. This method should never return None.  Changed in version 3.6.
new_event_loop()  
Create and return a new event loop object. This method should never return None.
set_child_watcher(watcher)  
Set the current child process watcher to watcher. This function is Unix specific.
set_event_loop(loop)  
Set the event loop for the current context to loop.
asyncio.all_tasks(loop=None)  
Return a set of not yet finished Task objects run by the loop. If loop is None, get_running_loop() is used for getting current loop.  New in version 3.7.
asyncio.subprocess.DEVNULL  
Special value that can be used as the stdin, stdout or stderr argument to process creation functions. It indicates that the special file os.devnull will be used for the corresponding subprocess stream.
asyncio.subprocess.PIPE  
Can be passed to the stdin, stdout or stderr parameters. If PIPE is passed to stdin argument, the Process.stdin attribute will point to a StreamWriter instance. If PIPE is passed to stdout or stderr arguments, the Process.stdout and Process.stderr attributes will point to StreamReader instances.
coroutine communicate(input=None)  
Interact with process:  send data to stdin (if input is not None); read data from stdout and stderr, until EOF is reached; wait for process to terminate.  The optional input argument is the data (bytes object) that will be sent to the child process. Return a tuple (stdout_data, stderr_data). If either BrokenPipeError or ConnectionResetError exception is raised when writing input into stdin, the exception is ignored. This condition occurs when the process exits before all data are written into stdin. If it is desired to send data to the process’ stdin, the process needs to be created with stdin=PIPE. Similarly, to get anything other than None in the result tuple, the process has to be created with stdout=PIPE and/or stderr=PIPE arguments. Note, that the data read is buffered in memory, so do not use this method if the data size is large or unlimited.
kill()  
Kill the child process. On POSIX systems this method sends SIGKILL to the child process. On Windows this method is an alias for terminate().
pid  
Process identification number (PID). Note that for processes created by the create_subprocess_shell() function, this attribute is the PID of the spawned shell.
returncode  
Return code of the process when it exits. A None value indicates that the process has not terminated yet. A negative value -N indicates that the child was terminated by signal N (POSIX only).
send_signal(signal)  
Sends the signal signal to the child process.  Note On Windows, SIGTERM is an alias for terminate(). CTRL_C_EVENT and CTRL_BREAK_EVENT can be sent to processes started with a creationflags parameter which includes CREATE_NEW_PROCESS_GROUP.
stderr  
Standard error stream (StreamReader) or None if the process was created with stderr=None.
stdin  
Standard input stream (StreamWriter) or None if the process was created with stdin=None.
stdout  
Standard output stream (StreamReader) or None if the process was created with stdout=None.
terminate()  
Stop the child process. On POSIX systems this method sends signal.SIGTERM to the child process. On Windows the Win32 API function TerminateProcess() is called to stop the child process.
coroutine wait()  
Wait for the child process to terminate. Set and return the returncode attribute.  Note This method can deadlock when using stdout=PIPE or stderr=PIPE and the child process generates so much output that it blocks waiting for the OS pipe buffer to accept more data. Use the communicate() method when using pipes to avoid this condition.
asyncio.subprocess.STDOUT  
Special value that can be used as the stderr argument and indicates that standard error should be redirected into standard output.
asyncio.as_completed(aws, *, loop=None, timeout=None)  
Run awaitable objects in the aws iterable concurrently. Return an iterator of coroutines. Each coroutine returned can be awaited to get the earliest next result from the iterable of the remaining awaitables. Raises asyncio.TimeoutError if the timeout occurs before all Futures are done.  Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.  Example: for coro in as_completed(aws):
    earliest_result = await coro
    # ...
BaseProtocol.connection_lost(exc)  
Called when the connection is lost or closed. The argument is either an exception object or None. The latter means a regular EOF is received, or the connection was aborted or closed by this side of the connection.
BaseProtocol.connection_made(transport)  
Called when a connection is made. The transport argument is the transport representing the connection. The protocol is responsible for storing the reference to its transport.
BaseProtocol.pause_writing()  
Called when the transport’s buffer goes over the high watermark.
BaseProtocol.resume_writing()  
Called when the transport’s buffer drains below the low watermark.
class asyncio.BaseTransport  
Base class for all transports. Contains methods that all asyncio transports share.
BaseTransport.close()  
Close the transport. If the transport has a buffer for outgoing data, buffered data will be flushed asynchronously. No more data will be received. After all buffered data is flushed, the protocol’s protocol.connection_lost() method will be called with None as its argument.
BaseTransport.get_extra_info(name, default=None)  
Return information about the transport or underlying resources it uses. name is a string representing the piece of transport-specific information to get. default is the value to return if the information is not available, or if the transport does not support querying it with the given third-party event loop implementation or on the current platform. For example, the following code attempts to get the underlying socket object of the transport: sock = transport.get_extra_info('socket')
if sock is not None:
    print(sock.getsockopt(...))
 Categories of information that can be queried on some transports:  
socket:  
'peername': the remote address to which the socket is connected, result of socket.socket.getpeername() (None on error) 
'socket': socket.socket instance 
'sockname': the socket’s own address, result of socket.socket.getsockname()
   
SSL socket:  
'compression': the compression algorithm being used as a string, or None if the connection isn’t compressed; result of ssl.SSLSocket.compression()
 
'cipher': a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used; result of ssl.SSLSocket.cipher()
 
'peercert': peer certificate; result of ssl.SSLSocket.getpeercert()
 
'sslcontext': ssl.SSLContext instance 
'ssl_object': ssl.SSLObject or ssl.SSLSocket instance   
pipe:  
'pipe': pipe object   
subprocess:  
'subprocess': subprocess.Popen instance
BaseTransport.is_closing()  
Return True if the transport is closing or is closed.
BaseTransport.set_protocol(protocol)  
Set a new protocol. Switching protocol should only be done when both protocols are documented to support the switch.
class asyncio.BoundedSemaphore(value=1, *, loop=None)  
A bounded semaphore object. Not thread-safe. Bounded Semaphore is a version of Semaphore that raises a ValueError in release() if it increases the internal counter above the initial value.  Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.
class asyncio.BufferedProtocol(BaseProtocol)  
A base class for implementing streaming protocols with manual control of the receive buffer.
BufferedProtocol.buffer_updated(nbytes)  
Called when the buffer was updated with the received data. nbytes is the total number of bytes that were written to the buffer.
BufferedProtocol.eof_received()  
See the documentation of the protocol.eof_received() method.
BufferedProtocol.get_buffer(sizehint)  
Called to allocate a new receive buffer. sizehint is the recommended minimum size for the returned buffer. It is acceptable to return smaller or larger buffers than what sizehint suggests. When set to -1, the buffer size can be arbitrary. It is an error to return a buffer with a zero size. get_buffer() must return an object implementing the buffer protocol.
exception asyncio.CancelledError  
The operation has been cancelled. This exception can be caught to perform custom operations when asyncio Tasks are cancelled. In almost all situations the exception must be re-raised.  Changed in version 3.8: CancelledError is now a subclass of BaseException.
class asyncio.Condition(lock=None, *, loop=None)  
A Condition object. Not thread-safe. An asyncio condition primitive can be used by a task to wait for some event to happen and then get exclusive access to a shared resource. In essence, a Condition object combines the functionality of an Event and a Lock. It is possible to have multiple Condition objects share one Lock, which allows coordinating exclusive access to a shared resource between different tasks interested in particular states of that shared resource. The optional lock argument must be a Lock object or None. In the latter case a new Lock object is created automatically.  Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.  The preferred way to use a Condition is an async with statement: cond = asyncio.Condition()

# ... later
async with cond:
    await cond.wait()
 which is equivalent to: cond = asyncio.Condition()

# ... later
await cond.acquire()
try:
    await cond.wait()
finally:
    cond.release()
  
coroutine acquire()  
Acquire the underlying lock. This method waits until the underlying lock is unlocked, sets it to locked and returns True. 
  
notify(n=1)  
Wake up at most n tasks (1 by default) waiting on this condition. The method is no-op if no tasks are waiting. The lock must be acquired before this method is called and released shortly after. If called with an unlocked lock a RuntimeError error is raised. 
  
locked()  
Return True if the underlying lock is acquired. 
  
notify_all()  
Wake up all tasks waiting on this condition. This method acts like notify(), but wakes up all waiting tasks. The lock must be acquired before this method is called and released shortly after. If called with an unlocked lock a RuntimeError error is raised. 
  
release()  
Release the underlying lock. When invoked on an unlocked lock, a RuntimeError is raised. 
  
coroutine wait()  
Wait until notified. If the calling task 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. Once awakened, the Condition re-acquires its lock and this method returns True. 
  
coroutine wait_for(predicate)  
Wait until a predicate becomes true. The predicate must be a callable which result will be interpreted as a boolean value. The final value is the return value.
coroutine acquire()  
Acquire the underlying lock. This method waits until the underlying lock is unlocked, sets it to locked and returns True.
notify(n=1)  
Wake up at most n tasks (1 by default) waiting on this condition. The method is no-op if no tasks are waiting. The lock must be acquired before this method is called and released shortly after. If called with an unlocked lock a RuntimeError error is raised.
notify_all()  
Wake up all tasks waiting on this condition. This method acts like notify(), but wakes up all waiting tasks. The lock must be acquired before this method is called and released shortly after. If called with an unlocked lock a RuntimeError error is raised.
release()  
Release the underlying lock. When invoked on an unlocked lock, a RuntimeError is raised.
coroutine wait()  
Wait until notified. If the calling task 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. Once awakened, the Condition re-acquires its lock and this method returns True.
coroutine wait_for(predicate)  
Wait until a predicate becomes true. The predicate must be a callable which result will be interpreted as a boolean value. The final value is the return value.
@asyncio.coroutine  
Decorator to mark generator-based coroutines. This decorator enables legacy generator-based coroutines to be compatible with async/await code: @asyncio.coroutine
def old_style_coroutine():
    yield from asyncio.sleep(1)

async def main():
    await old_style_coroutine()
 This decorator should not be used for async def coroutines.  Deprecated since version 3.8, will be removed in version 3.10: Use async def instead.
coroutine asyncio.create_subprocess_exec(program, *args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds)  
Create a subprocess. The limit argument sets the buffer limit for StreamReader wrappers for Process.stdout and Process.stderr (if subprocess.PIPE is passed to stdout and stderr arguments). Return a Process instance. See the documentation of loop.subprocess_exec() for other parameters.  Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.
coroutine asyncio.create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds)  
Run the cmd shell command. The limit argument sets the buffer limit for StreamReader wrappers for Process.stdout and Process.stderr (if subprocess.PIPE is passed to stdout and stderr arguments). Return a Process instance. See the documentation of loop.subprocess_shell() for other parameters.  Important It is the application’s responsibility to ensure that all whitespace and special characters are quoted appropriately to avoid shell injection vulnerabilities. The shlex.quote() function can be used to properly escape whitespace and special shell characters in strings that are going to be used to construct shell commands.   Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.
asyncio.create_task(coro, *, name=None)  
Wrap the coro coroutine into a Task and schedule its execution. Return the Task object. If name is not None, it is set as the name of the task using Task.set_name(). The task is executed in the loop returned by get_running_loop(), RuntimeError is raised if there is no running loop in current thread. This function has been added in Python 3.7. Prior to Python 3.7, the low-level asyncio.ensure_future() function can be used instead: async def coro():
    ...

# In Python 3.7+
task = asyncio.create_task(coro())
...

# This works in all Python versions but is less readable
task = asyncio.ensure_future(coro())
...
  New in version 3.7.   Changed in version 3.8: Added the name parameter.
asyncio.current_task(loop=None)  
Return the currently running Task instance, or None if no task is running. If loop is None get_running_loop() is used to get the current loop.  New in version 3.7.
class asyncio.DatagramProtocol(BaseProtocol)  
The base class for implementing datagram (UDP) protocols.
DatagramProtocol.datagram_received(data, addr)  
Called when a datagram is received. data is a bytes object containing the incoming data. addr is the address of the peer sending the data; the exact format depends on the transport.
DatagramProtocol.error_received(exc)  
Called when a previous send or receive operation raises an OSError. exc is the OSError instance. This method is called in rare conditions, when the transport (e.g. UDP) detects that a datagram could not be delivered to its recipient. In many conditions though, undeliverable datagrams will be silently dropped.
class asyncio.DatagramTransport(BaseTransport)  
A transport for datagram (UDP) connections. Instances of the DatagramTransport class are returned from the loop.create_datagram_endpoint() event loop method.
DatagramTransport.abort()  
Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol’s protocol.connection_lost() method will eventually be called with None as its argument.
DatagramTransport.sendto(data, addr=None)  
Send the data bytes to the remote peer given by addr (a transport-dependent target address). If addr is None, the data is sent to the target address given on transport creation. This method does not block; it buffers the data and arranges for it to be sent out asynchronously.
class asyncio.DefaultEventLoopPolicy  
The default asyncio policy. Uses SelectorEventLoop on Unix and ProactorEventLoop on Windows. There is no need to install the default policy manually. asyncio is configured to use the default policy automatically.  Changed in version 3.8: On Windows, ProactorEventLoop is now used by default.
asyncio.ensure_future(obj, *, loop=None)  
Return:  
obj argument as is, if obj is a Future, a Task, or a Future-like object (isfuture() is used for the test.) a Task object wrapping obj, if obj is a coroutine (iscoroutine() is used for the test); in this case the coroutine will be scheduled by ensure_future(). a Task object that would await on obj, if obj is an awaitable (inspect.isawaitable() is used for the test.)  If obj is neither of the above a TypeError is raised.  Important See also the create_task() function which is the preferred way for creating new Tasks.   Changed in version 3.5.1: The function accepts any awaitable object.
class asyncio.Event(*, loop=None)  
An event object. Not thread-safe. An asyncio event can be used to notify multiple asyncio tasks that some event has happened. An Event object manages an internal 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 set to true. The flag is set to false initially.  Deprecated since version 3.8, will be removed in version 3.10: The loop parameter.  Example: async def waiter(event):
    print('waiting for it ...')
    await event.wait()
    print('... got it!')

async def main():
    # Create an Event object.
    event = asyncio.Event()

    # Spawn a Task to wait until 'event' is set.
    waiter_task = asyncio.create_task(waiter(event))

    # Sleep for 1 second and set the event.
    await asyncio.sleep(1)
    event.set()

    # Wait until the waiter task is finished.
    await waiter_task

asyncio.run(main())
  
coroutine wait()  
Wait until the event is set. If the event is set, return True immediately. Otherwise block until another task calls set(). 
  
set()  
Set the event. All tasks waiting for event to be set will be immediately awakened. 
  
clear()  
Clear (unset) the event. Tasks awaiting on wait() will now block until the set() method is called again. 
  
is_set()  
Return True if the event is set.
clear()  
Clear (unset) the event. Tasks awaiting on wait() will now block until the set() method is called again.
set()  
Set the event. All tasks waiting for event to be set will be immediately awakened.
coroutine wait()  
Wait until the event is set. If the event is set, return True immediately. Otherwise block until another task calls set().
class asyncio.FastChildWatcher  
This implementation reaps every terminated processes by calling os.waitpid(-1) directly, possibly breaking other code spawning processes and waiting for their termination. There is no noticeable overhead when handling a big number of children (O(1) each time a child terminates). This solution requires a running event loop in the main thread to work, as SafeChildWatcher.
add_done_callback(callback, *, context=None)  
Add a callback to be run when the Future is done. The callback is called with the Future object as its only argument. If the Future is already done when this method is called, the callback is scheduled with loop.call_soon(). An optional keyword-only context argument allows specifying a custom contextvars.Context for the callback to run in. The current context is used when no context is provided. functools.partial() can be used to pass parameters to the callback, e.g.: # Call 'print("Future:", fut)' when "fut" is done.
fut.add_done_callback(
    functools.partial(print, "Future:"))
  Changed in version 3.7: The context keyword-only parameter was added. See PEP 567 for more details.
cancel(msg=None)  
Cancel the Future and schedule callbacks. If the Future is already done or cancelled, return False. Otherwise, change the Future’s state to cancelled, schedule the callbacks, and return True.  Changed in version 3.9: Added the msg parameter.
cancelled()  
Return True if the Future was cancelled. The method is usually used to check if a Future is not cancelled before setting a result or an exception for it: if not fut.cancelled():
    fut.set_result(42)
done()  
Return True if the Future is done. A Future is done if it was cancelled or if it has a result or an exception set with set_result() or set_exception() calls.
exception()  
Return the exception that was set on this Future. The exception (or None if no exception was set) is returned only if the Future is done. If the Future has been cancelled, this method raises a CancelledError exception. If the Future isn’t done yet, this method raises an InvalidStateError exception.
get_loop()  
Return the event loop the Future object is bound to.  New in version 3.7.
remove_done_callback(callback)  
Remove callback from the callbacks list. Returns the number of callbacks removed, which is typically 1, unless a callback was added more than once.
result()  
Return the result of the Future. If the Future is done and has a result set by the set_result() method, the result value is returned. If the Future is done and has an exception set by the set_exception() method, this method raises the exception. If the Future has been cancelled, this method raises a CancelledError exception. If the Future’s result isn’t yet available, this method raises a InvalidStateError exception.
set_exception(exception)  
Mark the Future as done and set an exception. Raises a InvalidStateError error if the Future is already done.
set_result(result)  
Mark the Future as done and set its result. Raises a InvalidStateError error if the Future is already done.