neulab/docprompting-conala huggingface dataset:
multiprocessing.get_logger()  
Returns the logger used by multiprocessing. If necessary, a new one will be created. When first created the logger has level logging.NOTSET and no default handler. Messages sent to this logger will not by default propagate to the root logger. Note that on Windows child processes will only inherit the level of the parent process’s logger – any other customization of the logger will not be inherited.
multiprocessing.get_start_method(allow_none=False)  
Return the name of start method used for starting processes. If the start method has not been fixed and allow_none is false, then the start method is fixed to the default and the name is returned. If the start method has not been fixed and allow_none is true then None is returned. The return value can be 'fork', 'spawn', 'forkserver' or None. 'fork' is the default on Unix, while 'spawn' is the default on Windows.  New in version 3.4.
class multiprocessing.JoinableQueue([maxsize])  
JoinableQueue, a Queue subclass, is a queue which additionally has task_done() and join() methods.  
task_done()  
Indicate that a formerly enqueued task is complete. Used by queue consumers. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises a ValueError if called more times than there were items placed in the queue. 
  
join()  
Block until all items in the queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks.
join()  
Block until all items in the queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks.
task_done()  
Indicate that a formerly enqueued task is complete. Used by queue consumers. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises a ValueError if called more times than there were items placed in the queue.
class multiprocessing.Lock  
A non-recursive lock object: a close analog of threading.Lock. Once a process or thread has acquired a lock, subsequent attempts to acquire it from any process or thread will block until it is released; any process or thread may release it. The concepts and behaviors of threading.Lock as it applies to threads are replicated here in multiprocessing.Lock as it applies to either processes or threads, except as noted. Note that Lock is actually a factory function which returns an instance of multiprocessing.synchronize.Lock initialized with a default context. Lock supports the context manager protocol and thus may be used in with statements.  
acquire(block=True, timeout=None)  
Acquire a lock, blocking or non-blocking. With the block argument set to True (the default), the method call will block until the lock is in an unlocked state, then set it to locked and return True. Note that the name of this first argument differs from that in threading.Lock.acquire(). With the block argument set to False, the method call does not block. If the lock is currently in a locked state, return False; otherwise set the lock to a locked state and return True. When invoked with a positive, floating-point value for timeout, block for at most the number of seconds specified by timeout as long as the lock can not be acquired. Invocations with a negative value for timeout are equivalent to a timeout of zero. Invocations with a timeout value of None (the default) set the timeout period to infinite. Note that the treatment of negative or None values for timeout differs from the implemented behavior in threading.Lock.acquire(). The timeout argument has no practical implications if the block argument is set to False and is thus ignored. Returns True if the lock has been acquired or False if the timeout period has elapsed. 
  
release()  
Release a lock. This can be called from any process or thread, not only the process or thread which originally acquired the lock. Behavior is the same as in threading.Lock.release() except that when invoked on an unlocked lock, a ValueError is raised.
acquire(block=True, timeout=None)  
Acquire a lock, blocking or non-blocking. With the block argument set to True (the default), the method call will block until the lock is in an unlocked state, then set it to locked and return True. Note that the name of this first argument differs from that in threading.Lock.acquire(). With the block argument set to False, the method call does not block. If the lock is currently in a locked state, return False; otherwise set the lock to a locked state and return True. When invoked with a positive, floating-point value for timeout, block for at most the number of seconds specified by timeout as long as the lock can not be acquired. Invocations with a negative value for timeout are equivalent to a timeout of zero. Invocations with a timeout value of None (the default) set the timeout period to infinite. Note that the treatment of negative or None values for timeout differs from the implemented behavior in threading.Lock.acquire(). The timeout argument has no practical implications if the block argument is set to False and is thus ignored. Returns True if the lock has been acquired or False if the timeout period has elapsed.
release()  
Release a lock. This can be called from any process or thread, not only the process or thread which originally acquired the lock. Behavior is the same as in threading.Lock.release() except that when invoked on an unlocked lock, a ValueError is raised.
multiprocessing.log_to_stderr()  
This function performs a call to get_logger() but in addition to returning the logger created by get_logger, it adds a handler which sends output to sys.stderr using format '[%(levelname)s/%(processName)s] %(message)s'.
connect()  
Connect a local manager object to a remote manager process: >>> from multiprocessing.managers import BaseManager
>>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')
>>> m.connect()
get_server()  
Returns a Server object which represents the actual server under the control of the Manager. The Server object supports the serve_forever() method: >>> from multiprocessing.managers import BaseManager
>>> manager = BaseManager(address=('', 50000), authkey=b'abc')
>>> server = manager.get_server()
>>> server.serve_forever()
 Server additionally has an address attribute.
register(typeid[, callable[, proxytype[, exposed[, method_to_typeid[, create_method]]]]])  
A classmethod which can be used for registering a type or callable with the manager class. typeid is a “type identifier” which is used to identify a particular type of shared object. This must be a string. callable is a callable used for creating objects for this type identifier. If a manager instance will be connected to the server using the connect() method, or if the create_method argument is False then this can be left as None. proxytype is a subclass of BaseProxy which is used to create proxies for shared objects with this typeid. If None then a proxy class is created automatically. exposed is used to specify a sequence of method names which proxies for this typeid should be allowed to access using BaseProxy._callmethod(). (If exposed is None then proxytype._exposed_ is used instead if it exists.) In the case where no exposed list is specified, all “public methods” of the shared object will be accessible. (Here a “public method” means any attribute which has a __call__() method and whose name does not begin with '_'.) method_to_typeid is a mapping used to specify the return type of those exposed methods which should return a proxy. It maps method names to typeid strings. (If method_to_typeid is None then proxytype._method_to_typeid_ is used instead if it exists.) If a method’s name is not a key of this mapping or if the mapping is None then the object returned by the method will be copied by value. create_method determines whether a method should be created with name typeid which can be used to tell the server process to create a new shared object and return a proxy for it. By default it is True.
shutdown()  
Stop the process used by the manager. This is only available if start() has been used to start the server process. This can be called multiple times.
start([initializer[, initargs]])  
Start a subprocess to start the manager. If initializer is not None then the subprocess will call initializer(*initargs) when it starts.
class multiprocessing.managers.BaseProxy  
Proxy objects are instances of subclasses of BaseProxy.  
_callmethod(methodname[, args[, kwds]])  
Call and return the result of a method of the proxy’s referent. If proxy is a proxy whose referent is obj then the expression proxy._callmethod(methodname, args, kwds)
 will evaluate the expression getattr(obj, methodname)(*args, **kwds)
 in the manager’s process. The returned value will be a copy of the result of the call or a proxy to a new shared object – see documentation for the method_to_typeid argument of BaseManager.register(). If an exception is raised by the call, then is re-raised by _callmethod(). If some other exception is raised in the manager’s process then this is converted into a RemoteError exception and is raised by _callmethod(). Note in particular that an exception will be raised if methodname has not been exposed. An example of the usage of _callmethod(): >>> l = manager.list(range(10))
>>> l._callmethod('__len__')
10
>>> l._callmethod('__getitem__', (slice(2, 7),)) # equivalent to l[2:7]
[2, 3, 4, 5, 6]
>>> l._callmethod('__getitem__', (20,))          # equivalent to l[20]
Traceback (most recent call last):
...
IndexError: list index out of range
 
  
_getvalue()  
Return a copy of the referent. If the referent is unpicklable then this will raise an exception. 
  
__repr__()  
Return a representation of the proxy object. 
  
__str__()  
Return the representation of the referent.
_callmethod(methodname[, args[, kwds]])  
Call and return the result of a method of the proxy’s referent. If proxy is a proxy whose referent is obj then the expression proxy._callmethod(methodname, args, kwds)
 will evaluate the expression getattr(obj, methodname)(*args, **kwds)
 in the manager’s process. The returned value will be a copy of the result of the call or a proxy to a new shared object – see documentation for the method_to_typeid argument of BaseManager.register(). If an exception is raised by the call, then is re-raised by _callmethod(). If some other exception is raised in the manager’s process then this is converted into a RemoteError exception and is raised by _callmethod(). Note in particular that an exception will be raised if methodname has not been exposed. An example of the usage of _callmethod(): >>> l = manager.list(range(10))
>>> l._callmethod('__len__')
10
>>> l._callmethod('__getitem__', (slice(2, 7),)) # equivalent to l[2:7]
[2, 3, 4, 5, 6]
>>> l._callmethod('__getitem__', (20,))          # equivalent to l[20]
Traceback (most recent call last):
...
IndexError: list index out of range
_getvalue()  
Return a copy of the referent. If the referent is unpicklable then this will raise an exception.
class multiprocessing.managers.Namespace  
A type that can register with SyncManager. A namespace object has no public methods, but does have writable attributes. Its representation shows the values of its attributes. However, when using a proxy for a namespace object, an attribute beginning with '_' will be an attribute of the proxy and not an attribute of the referent: >>> manager = multiprocessing.Manager()
>>> Global = manager.Namespace()
>>> Global.x = 10
>>> Global.y = 'hello'
>>> Global._z = 12.3    # this is an attribute of the proxy
>>> print(Global)
Namespace(x=10, y='hello')
class multiprocessing.managers.SharedMemoryManager([address[, authkey]])  
A subclass of BaseManager which can be used for the management of shared memory blocks across processes. A call to start() on a SharedMemoryManager instance causes a new process to be started. This new process’s sole purpose is to manage the life cycle of all shared memory blocks created through it. To trigger the release of all shared memory blocks managed by that process, call shutdown() on the instance. This triggers a SharedMemory.unlink() call on all of the SharedMemory objects managed by that process and then stops the process itself. By creating SharedMemory instances through a SharedMemoryManager, we avoid the need to manually track and trigger the freeing of shared memory resources. This class provides methods for creating and returning SharedMemory instances and for creating a list-like object (ShareableList) backed by shared memory. Refer to multiprocessing.managers.BaseManager for a description of the inherited address and authkey optional input arguments and how they may be used to connect to an existing SharedMemoryManager service from other processes.  
SharedMemory(size)  
Create and return a new SharedMemory object with the specified size in bytes. 
  
ShareableList(sequence)  
Create and return a new ShareableList object, initialized by the values from the input sequence.
ShareableList(sequence)  
Create and return a new ShareableList object, initialized by the values from the input sequence.
SharedMemory(size)  
Create and return a new SharedMemory object with the specified size in bytes.
class multiprocessing.managers.SyncManager  
A subclass of BaseManager which can be used for the synchronization of processes. Objects of this type are returned by multiprocessing.Manager(). Its methods create and return Proxy Objects for a number of commonly used data types to be synchronized across processes. This notably includes shared lists and dictionaries.  
Barrier(parties[, action[, timeout]])  
Create a shared threading.Barrier object and return a proxy for it.  New in version 3.3.  
  
BoundedSemaphore([value])  
Create a shared threading.BoundedSemaphore object and return a proxy for it. 
  
Condition([lock])  
Create a shared threading.Condition object and return a proxy for it. If lock is supplied then it should be a proxy for a threading.Lock or threading.RLock object.  Changed in version 3.3: The wait_for() method was added.  
  
Event()  
Create a shared threading.Event object and return a proxy for it. 
  
Lock()  
Create a shared threading.Lock object and return a proxy for it. 
  
Namespace()  
Create a shared Namespace object and return a proxy for it. 
  
Queue([maxsize])  
Create a shared queue.Queue object and return a proxy for it. 
  
RLock()  
Create a shared threading.RLock object and return a proxy for it. 
  
Semaphore([value])  
Create a shared threading.Semaphore object and return a proxy for it. 
  
Array(typecode, sequence)  
Create an array and return a proxy for it. 
  
Value(typecode, value)  
Create an object with a writable value attribute and return a proxy for it. 
  
dict()  
dict(mapping)  
dict(sequence)  
Create a shared dict object and return a proxy for it. 
  
list()  
list(sequence)  
Create a shared list object and return a proxy for it. 
  Changed in version 3.6: Shared objects are capable of being nested. For example, a shared container object such as a shared list can contain other shared objects which will all be managed and synchronized by the SyncManager.
Barrier(parties[, action[, timeout]])  
Create a shared threading.Barrier object and return a proxy for it.  New in version 3.3.
BoundedSemaphore([value])  
Create a shared threading.BoundedSemaphore object and return a proxy for it.
Condition([lock])  
Create a shared threading.Condition object and return a proxy for it. If lock is supplied then it should be a proxy for a threading.Lock or threading.RLock object.  Changed in version 3.3: The wait_for() method was added.
dict()  
dict(mapping)  
dict(sequence)  
Create a shared dict object and return a proxy for it.
list()  
list(sequence)  
Create a shared list object and return a proxy for it.
Queue([maxsize])  
Create a shared queue.Queue object and return a proxy for it.
RLock()  
Create a shared threading.RLock object and return a proxy for it.
Semaphore([value])  
Create a shared threading.Semaphore object and return a proxy for it.
Value(typecode, value)  
Create an object with a writable value attribute and return a proxy for it.
multiprocessing.parent_process()  
Return the Process object corresponding to the parent process of the current_process(). For the main process, parent_process will be None.  New in version 3.8.
multiprocessing.Pipe([duplex])  
Returns a pair (conn1, conn2) of Connection objects representing the ends of a pipe. If duplex is True (the default) then the pipe is bidirectional. If duplex is False then the pipe is unidirectional: conn1 can only be used for receiving messages and conn2 can only be used for sending messages.
class multiprocessing.pool.AsyncResult  
The class of the result returned by Pool.apply_async() and Pool.map_async().  
get([timeout])  
Return the result when it arrives. If timeout is not None and the result does not arrive within timeout seconds then multiprocessing.TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get(). 
  
wait([timeout])  
Wait until the result is available or until timeout seconds pass. 
  
ready()  
Return whether the call has completed. 
  
successful()  
Return whether the call completed without raising an exception. Will raise ValueError if the result is not ready.  Changed in version 3.7: If the result is not ready, ValueError is raised instead of AssertionError.
get([timeout])  
Return the result when it arrives. If timeout is not None and the result does not arrive within timeout seconds then multiprocessing.TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get().
successful()  
Return whether the call completed without raising an exception. Will raise ValueError if the result is not ready.  Changed in version 3.7: If the result is not ready, ValueError is raised instead of AssertionError.
apply(func[, args[, kwds]])  
Call func with arguments args and keyword arguments kwds. It blocks until the result is ready. Given this blocks, apply_async() is better suited for performing work in parallel. Additionally, func is only executed in one of the workers of the pool.
apply_async(func[, args[, kwds[, callback[, error_callback]]]])  
A variant of the apply() method which returns a AsyncResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it, that is unless the call failed, in which case the error_callback is applied instead. If error_callback is specified then it should be a callable which accepts a single argument. If the target function fails, then the error_callback is called with the exception instance. Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.
close()  
Prevents any more tasks from being submitted to the pool. Once all the tasks have been completed the worker processes will exit.
imap(func, iterable[, chunksize])  
A lazier version of map(). The chunksize argument is the same as the one used by the map() method. For very long iterables using a large value for chunksize can make the job complete much faster than using the default value of 1. Also if chunksize is 1 then the next() method of the iterator returned by the imap() method has an optional timeout parameter: next(timeout) will raise multiprocessing.TimeoutError if the result cannot be returned within timeout seconds.
imap_unordered(func, iterable[, chunksize])  
The same as imap() except that the ordering of the results from the returned iterator should be considered arbitrary. (Only when there is only one worker process is the order guaranteed to be “correct”.)
join()  
Wait for the worker processes to exit. One must call close() or terminate() before using join().
map(func, iterable[, chunksize])  
A parallel equivalent of the map() built-in function (it supports only one iterable argument though, for multiple iterables see starmap()). It blocks until the result is ready. This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting chunksize to a positive integer. Note that it may cause high memory usage for very long iterables. Consider using imap() or imap_unordered() with explicit chunksize option for better efficiency.
map_async(func, iterable[, chunksize[, callback[, error_callback]]])  
A variant of the map() method which returns a AsyncResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it, that is unless the call failed, in which case the error_callback is applied instead. If error_callback is specified then it should be a callable which accepts a single argument. If the target function fails, then the error_callback is called with the exception instance. Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.
starmap(func, iterable[, chunksize])  
Like map() except that the elements of the iterable are expected to be iterables that are unpacked as arguments. Hence an iterable of [(1,2), (3, 4)] results in [func(1,2),
func(3,4)].  New in version 3.3.
starmap_async(func, iterable[, chunksize[, callback[, error_callback]]])  
A combination of starmap() and map_async() that iterates over iterable of iterables and calls func with the iterables unpacked. Returns a result object.  New in version 3.3.
terminate()  
Stops the worker processes immediately without completing outstanding work. When the pool object is garbage collected terminate() will be called immediately.
class multiprocessing.pool.ThreadPool([processes[, initializer[, initargs]]])  
A thread pool object which controls a pool of worker threads to which jobs can be submitted. ThreadPool instances are fully interface compatible with Pool instances, and their resources must also be properly managed, either by using the pool as a context manager or by calling close() and terminate() manually. processes is the number of worker threads to use. If processes is None then the number returned by os.cpu_count() is used. If initializer is not None then each worker process will call initializer(*initargs) when it starts. Unlike Pool, maxtasksperchild and context cannot be provided.  Note A ThreadPool shares the same interface as Pool, which is designed around a pool of processes and predates the introduction of the concurrent.futures module. As such, it inherits some operations that don’t make sense for a pool backed by threads, and it has its own type for representing the status of asynchronous jobs, AsyncResult, that is not understood by any other libraries. Users should generally prefer to use concurrent.futures.ThreadPoolExecutor, which has a simpler interface that was designed around threads from the start, and which returns concurrent.futures.Future instances that are compatible with many other libraries, including asyncio.
authkey  
The process’s authentication key (a byte string). When multiprocessing is initialized the main process is assigned a random string using os.urandom(). When a Process object is created, it will inherit the authentication key of its parent process, although this may be changed by setting authkey to another byte string. See Authentication keys.