neulab/docprompting-conala huggingface dataset:
os.register_at_fork(*, before=None, after_in_parent=None, after_in_child=None)  
Register callables to be executed when a new child process is forked using os.fork() or similar process cloning APIs. The parameters are optional and keyword-only. Each specifies a different call point.  
before is a function called before forking a child process. 
after_in_parent is a function called from the parent process after forking a child process. 
after_in_child is a function called from the child process.  These calls are only made if control is expected to return to the Python interpreter. A typical subprocess launch will not trigger them as the child is not going to re-enter the interpreter. Functions registered for execution before forking are called in reverse registration order. Functions registered for execution after forking (either in the parent or in the child) are called in registration order. Note that fork() calls made by third-party C code may not call those functions, unless it explicitly calls PyOS_BeforeFork(), PyOS_AfterFork_Parent() and PyOS_AfterFork_Child(). There is no way to unregister a function. Availability: Unix.  New in version 3.7.
os.remove(path, *, dir_fd=None)  
Remove (delete) the file path. If path is a directory, an IsADirectoryError is raised. Use rmdir() to remove directories. If the file does not exist, a FileNotFoundError is raised. This function can support paths relative to directory descriptors. On Windows, attempting to remove a file that is in use causes an exception to be raised; on Unix, the directory entry is removed but the storage allocated to the file is not made available until the original file is no longer in use. This function is semantically identical to unlink(). Raises an auditing event os.remove with arguments path, dir_fd.  New in version 3.3: The dir_fd argument.   Changed in version 3.6: Accepts a path-like object.
os.removedirs(name)  
Remove directories recursively. Works like rmdir() except that, if the leaf directory is successfully removed, removedirs() tries to successively remove every parent directory mentioned in path until an error is raised (which is ignored, because it generally means that a parent directory is not empty). For example, os.removedirs('foo/bar/baz') will first remove the directory 'foo/bar/baz', and then remove 'foo/bar' and 'foo' if they are empty. Raises OSError if the leaf directory could not be successfully removed. Raises an auditing event os.remove with arguments path, dir_fd.  Changed in version 3.6: Accepts a path-like object.
os.removexattr(path, attribute, *, follow_symlinks=True)  
Removes the extended filesystem attribute attribute from path. attribute should be bytes or str (directly or indirectly through the PathLike interface). If it is a string, it is encoded with the filesystem encoding. This function can support specifying a file descriptor and not following symlinks. Raises an auditing event os.removexattr with arguments path, attribute.  Changed in version 3.6: Accepts a path-like object for path and attribute.
os.rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)  
Rename the file or directory src to dst. If dst exists, the operation will fail with an OSError subclass in a number of cases: On Windows, if dst exists a FileExistsError is always raised. On Unix, if src is a file and dst is a directory or vice-versa, an IsADirectoryError or a NotADirectoryError will be raised respectively. If both are directories and dst is empty, dst will be silently replaced. If dst is a non-empty directory, an OSError is raised. If both are files, dst it will be replaced silently if the user has permission. The operation may fail on some Unix flavors if src and dst are on different filesystems. If successful, the renaming will be an atomic operation (this is a POSIX requirement). This function can support specifying src_dir_fd and/or dst_dir_fd to supply paths relative to directory descriptors. If you want cross-platform overwriting of the destination, use replace(). Raises an auditing event os.rename with arguments src, dst, src_dir_fd, dst_dir_fd.  New in version 3.3: The src_dir_fd and dst_dir_fd arguments.   Changed in version 3.6: Accepts a path-like object for src and dst.
os.renames(old, new)  
Recursive directory or file renaming function. Works like rename(), except creation of any intermediate directories needed to make the new pathname good is attempted first. After the rename, directories corresponding to rightmost path segments of the old name will be pruned away using removedirs().  Note This function can fail with the new directory structure made if you lack permissions needed to remove the leaf directory or file.  Raises an auditing event os.rename with arguments src, dst, src_dir_fd, dst_dir_fd.  Changed in version 3.6: Accepts a path-like object for old and new.
os.replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)  
Rename the file or directory src to dst. If dst is a directory, OSError will be raised. If dst exists and is a file, it will be replaced silently if the user has permission. The operation may fail if src and dst are on different filesystems. If successful, the renaming will be an atomic operation (this is a POSIX requirement). This function can support specifying src_dir_fd and/or dst_dir_fd to supply paths relative to directory descriptors. Raises an auditing event os.rename with arguments src, dst, src_dir_fd, dst_dir_fd.  New in version 3.3.   Changed in version 3.6: Accepts a path-like object for src and dst.
os.rmdir(path, *, dir_fd=None)  
Remove (delete) the directory path. If the directory does not exist or is not empty, an FileNotFoundError or an OSError is raised respectively. In order to remove whole directory trees, shutil.rmtree() can be used. This function can support paths relative to directory descriptors. Raises an auditing event os.rmdir with arguments path, dir_fd.  New in version 3.3: The dir_fd parameter.   Changed in version 3.6: Accepts a path-like object.
os.RTLD_LAZY  
os.RTLD_NOW  
os.RTLD_GLOBAL  
os.RTLD_LOCAL  
os.RTLD_NODELETE  
os.RTLD_NOLOAD  
os.RTLD_DEEPBIND  
Flags for use with the setdlopenflags() and getdlopenflags() functions. See the Unix manual page dlopen(3) for what the different flags mean.  New in version 3.3.
os.RWF_DSYNC  
Provide a per-write equivalent of the O_DSYNC open(2) flag. This flag effect applies only to the data range written by the system call. Availability: Linux 4.7 and newer.  New in version 3.7.
os.RWF_HIPRI  
High priority read/write. Allows block-based filesystems to use polling of the device, which provides lower latency, but may use additional resources. Currently, on Linux, this feature is usable only on a file descriptor opened using the O_DIRECT flag. Availability: Linux 4.6 and newer.  New in version 3.7.
os.RWF_NOWAIT  
Do not wait for data which is not immediately available. If this flag is specified, the system call will return instantly if it would have to read data from the backing storage or wait for a lock. If some data was successfully read, it will return the number of bytes read. If no bytes were read, it will return -1 and set errno to errno.EAGAIN. Availability: Linux 4.14 and newer.  New in version 3.7.
os.RWF_SYNC  
Provide a per-write equivalent of the O_SYNC open(2) flag. This flag effect applies only to the data range written by the system call. Availability: Linux 4.7 and newer.  New in version 3.7.
os.scandir(path='.')  
Return an iterator of os.DirEntry objects corresponding to the entries in the directory given by path. The entries are yielded in arbitrary order, and the special entries '.' and '..' are not included. If a file is removed from or added to the directory after creating the iterator, whether an entry for that file be included is unspecified. Using scandir() instead of listdir() can significantly increase the performance of code that also needs file type or file attribute information, because os.DirEntry objects expose this information if the operating system provides it when scanning a directory. All os.DirEntry methods may perform a system call, but is_dir() and is_file() usually only require a system call for symbolic links; os.DirEntry.stat() always requires a system call on Unix but only requires one for symbolic links on Windows. path may be a path-like object. If path is of type bytes (directly or indirectly through the PathLike interface), the type of the name and path attributes of each os.DirEntry will be bytes; in all other circumstances, they will be of type str. This function can also support specifying a file descriptor; the file descriptor must refer to a directory. Raises an auditing event os.scandir with argument path. The scandir() iterator supports the context manager protocol and has the following method:  
scandir.close()  
Close the iterator and free acquired resources. This is called automatically when the iterator is exhausted or garbage collected, or when an error happens during iterating. However it is advisable to call it explicitly or use the with statement.  New in version 3.6.  
 The following example shows a simple use of scandir() to display all the files (excluding directories) in the given path that don’t start with '.'. The entry.is_file() call will generally not make an additional system call: with os.scandir(path) as it:
    for entry in it:
        if not entry.name.startswith('.') and entry.is_file():
            print(entry.name)
  Note On Unix-based systems, scandir() uses the system’s opendir() and readdir() functions. On Windows, it uses the Win32 FindFirstFileW and FindNextFileW functions.   New in version 3.5.   New in version 3.6: Added support for the context manager protocol and the close() method. If a scandir() iterator is neither exhausted nor explicitly closed a ResourceWarning will be emitted in its destructor. The function accepts a path-like object.   Changed in version 3.7: Added support for file descriptors on Unix.
scandir.close()  
Close the iterator and free acquired resources. This is called automatically when the iterator is exhausted or garbage collected, or when an error happens during iterating. However it is advisable to call it explicitly or use the with statement.  New in version 3.6.
os.SCHED_BATCH  
Scheduling policy for CPU-intensive processes that tries to preserve interactivity on the rest of the computer.
os.sched_getaffinity(pid)  
Return the set of CPUs the process with PID pid (or the current process if zero) is restricted to.
os.sched_getparam(pid)  
Return the scheduling parameters as a sched_param instance for the process with PID pid. A pid of 0 means the calling process.
os.sched_getscheduler(pid)  
Return the scheduling policy for the process with PID pid. A pid of 0 means the calling process. The result is one of the scheduling policy constants above.
os.sched_get_priority_max(policy)  
Get the maximum priority value for policy. policy is one of the scheduling policy constants above.
os.sched_get_priority_min(policy)  
Get the minimum priority value for policy. policy is one of the scheduling policy constants above.
class os.sched_param(sched_priority)  
This class represents tunable scheduling parameters used in sched_setparam(), sched_setscheduler(), and sched_getparam(). It is immutable. At the moment, there is only one possible parameter:  
sched_priority  
The scheduling priority for a scheduling policy.
os.SCHED_RESET_ON_FORK  
This flag can be OR’ed with any other scheduling policy. When a process with this flag set forks, its child’s scheduling policy and priority are reset to the default.
os.sched_rr_get_interval(pid)  
Return the round-robin quantum in seconds for the process with PID pid. A pid of 0 means the calling process.
os.sched_setaffinity(pid, mask)  
Restrict the process with PID pid (or the current process if zero) to a set of CPUs. mask is an iterable of integers representing the set of CPUs to which the process should be restricted.
os.sched_setparam(pid, param)  
Set a scheduling parameters for the process with PID pid. A pid of 0 means the calling process. param is a sched_param instance.
os.sched_setscheduler(pid, policy, param)  
Set the scheduling policy for the process with PID pid. A pid of 0 means the calling process. policy is one of the scheduling policy constants above. param is a sched_param instance.
os.SEEK_SET  
os.SEEK_CUR  
os.SEEK_END  
Parameters to the lseek() function. Their values are 0, 1, and 2, respectively.  New in version 3.3: Some operating systems could support additional values, like os.SEEK_HOLE or os.SEEK_DATA.
os.sendfile(out_fd, in_fd, offset, count)  
os.sendfile(out_fd, in_fd, offset, count, headers=(), trailers=(), flags=0)  
Copy count bytes from file descriptor in_fd to file descriptor out_fd starting at offset. Return the number of bytes sent. When EOF is reached return 0. The first function notation is supported by all platforms that define sendfile(). On Linux, if offset is given as None, the bytes are read from the current position of in_fd and the position of in_fd is updated. The second case may be used on Mac OS X and FreeBSD where headers and trailers are arbitrary sequences of buffers that are written before and after the data from in_fd is written. It returns the same as the first case. On Mac OS X and FreeBSD, a value of 0 for count specifies to send until the end of in_fd is reached. All platforms support sockets as out_fd file descriptor, and some platforms allow other types (e.g. regular file, pipe) as well. Cross-platform applications should not use headers, trailers and flags arguments. Availability: Unix.  Note For a higher-level wrapper of sendfile(), see socket.socket.sendfile().   New in version 3.3.   Changed in version 3.9: Parameters out and in was renamed to out_fd and in_fd.
os.sep  
The character used by the operating system to separate pathname components. This is '/' for POSIX and '\\' for Windows. Note that knowing this is not sufficient to be able to parse or concatenate pathnames — use os.path.split() and os.path.join() — but it is occasionally useful. Also available via os.path.
os.setegid(egid)  
Set the current process’s effective group id. Availability: Unix.
os.seteuid(euid)  
Set the current process’s effective user id. Availability: Unix.
os.setgid(gid)  
Set the current process’ group id. Availability: Unix.
os.setgroups(groups)  
Set the list of supplemental group ids associated with the current process to groups. groups must be a sequence, and each element must be an integer identifying a group. This operation is typically available only to the superuser. Availability: Unix.  Note On Mac OS X, the length of groups may not exceed the system-defined maximum number of effective group ids, typically 16. See the documentation for getgroups() for cases where it may not return the same group list set by calling setgroups().
os.setpgid(pid, pgrp)  
Call the system call setpgid() to set the process group id of the process with id pid to the process group with id pgrp. See the Unix manual for the semantics. Availability: Unix.
os.setpgrp()  
Call the system call setpgrp() or setpgrp(0, 0) depending on which version is implemented (if any). See the Unix manual for the semantics. Availability: Unix.
os.setpriority(which, who, priority)  
Set program scheduling priority. The value which is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and who is interpreted relative to which (a process identifier for PRIO_PROCESS, process group identifier for PRIO_PGRP, and a user ID for PRIO_USER). A zero value for who denotes (respectively) the calling process, the process group of the calling process, or the real user ID of the calling process. priority is a value in the range -20 to 19. The default priority is 0; lower priorities cause more favorable scheduling. Availability: Unix.  New in version 3.3.
os.setregid(rgid, egid)  
Set the current process’s real and effective group ids. Availability: Unix.
os.setresgid(rgid, egid, sgid)  
Set the current process’s real, effective, and saved group ids. Availability: Unix.  New in version 3.2.
os.setresuid(ruid, euid, suid)  
Set the current process’s real, effective, and saved user ids. Availability: Unix.  New in version 3.2.
os.setreuid(ruid, euid)  
Set the current process’s real and effective user ids. Availability: Unix.
os.setsid()  
Call the system call setsid(). See the Unix manual for the semantics. Availability: Unix.
os.setuid(uid)  
Set the current process’s user id. Availability: Unix.
os.setxattr(path, attribute, value, flags=0, *, follow_symlinks=True)  
Set the extended filesystem attribute attribute on path to value. attribute must be a bytes or str with no embedded NULs (directly or indirectly through the PathLike interface). If it is a str, it is encoded with the filesystem encoding. flags may be XATTR_REPLACE or XATTR_CREATE. If XATTR_REPLACE is given and the attribute does not exist, EEXISTS will be raised. If XATTR_CREATE is given and the attribute already exists, the attribute will not be created and ENODATA will be raised. This function can support specifying a file descriptor and not following symlinks.  Note A bug in Linux kernel versions less than 2.6.39 caused the flags argument to be ignored on some filesystems.  Raises an auditing event os.setxattr with arguments path, attribute, value, flags.  Changed in version 3.6: Accepts a path-like object for path and attribute.
os.set_blocking(fd, blocking)  
Set the blocking mode of the specified file descriptor. Set the O_NONBLOCK flag if blocking is False, clear the flag otherwise. See also get_blocking() and socket.socket.setblocking(). Availability: Unix.  New in version 3.5.
os.set_handle_inheritable(handle, inheritable)  
Set the “inheritable” flag of the specified handle. Availability: Windows.
os.set_inheritable(fd, inheritable)  
Set the “inheritable” flag of the specified file descriptor.
os.SF_NODISKIO  
os.SF_MNOWAIT  
os.SF_SYNC  
Parameters to the sendfile() function, if the implementation supports them. Availability: Unix.  New in version 3.3.
os.startfile(path[, operation])  
Start a file with its associated application. When operation is not specified or 'open', this acts like double-clicking the file in Windows Explorer, or giving the file name as an argument to the start command from the interactive command shell: the file is opened with whatever application (if any) its extension is associated. When another operation is given, it must be a “command verb” that specifies what should be done with the file. Common verbs documented by Microsoft are 'print' and 'edit' (to be used on files) as well as 'explore' and 'find' (to be used on directories). startfile() returns as soon as the associated application is launched. There is no option to wait for the application to close, and no way to retrieve the application’s exit status. The path parameter is relative to the current directory. If you want to use an absolute path, make sure the first character is not a slash ('/'); the underlying Win32 ShellExecute() function doesn’t work if it is. Use the os.path.normpath() function to ensure that the path is properly encoded for Win32. To reduce interpreter startup overhead, the Win32 ShellExecute() function is not resolved until this function is first called. If the function cannot be resolved, NotImplementedError will be raised. Raises an auditing event os.startfile with arguments path, operation. Availability: Windows.
os.stat(path, *, dir_fd=None, follow_symlinks=True)  
Get the status of a file or a file descriptor. Perform the equivalent of a stat() system call on the given path. path may be specified as either a string or bytes – directly or indirectly through the PathLike interface – or as an open file descriptor. Return a stat_result object. This function normally follows symlinks; to stat a symlink add the argument follow_symlinks=False, or use lstat(). This function can support specifying a file descriptor and not following symlinks. On Windows, passing follow_symlinks=False will disable following all name-surrogate reparse points, which includes symlinks and directory junctions. Other types of reparse points that do not resemble links or that the operating system is unable to follow will be opened directly. When following a chain of multiple links, this may result in the original link being returned instead of the non-link that prevented full traversal. To obtain stat results for the final path in this case, use the os.path.realpath() function to resolve the path name as far as possible and call lstat() on the result. This does not apply to dangling symlinks or junction points, which will raise the usual exceptions. Example: >>> import os
>>> statinfo = os.stat('somefile.txt')
>>> statinfo
os.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026,
st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295,
st_mtime=1297230027, st_ctime=1297230027)
>>> statinfo.st_size
264
  See also fstat() and lstat() functions.   New in version 3.3: Added the dir_fd and follow_symlinks arguments, specifying a file descriptor instead of a path.   Changed in version 3.6: Accepts a path-like object.   Changed in version 3.8: On Windows, all reparse points that can be resolved by the operating system are now followed, and passing follow_symlinks=False disables following all name surrogate reparse points. If the operating system reaches a reparse point that it is not able to follow, stat now returns the information for the original path as if follow_symlinks=False had been specified instead of raising an error.
os.statvfs(path)  
Perform a statvfs() system call on the given path. The return value is an object whose attributes describe the filesystem on the given path, and correspond to the members of the statvfs structure, namely: f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files, f_ffree, f_favail, f_flag, f_namemax, f_fsid. Two module-level constants are defined for the f_flag attribute’s bit-flags: if ST_RDONLY is set, the filesystem is mounted read-only, and if ST_NOSUID is set, the semantics of setuid/setgid bits are disabled or not supported. Additional module-level constants are defined for GNU/glibc based systems. These are ST_NODEV (disallow access to device special files), ST_NOEXEC (disallow program execution), ST_SYNCHRONOUS (writes are synced at once), ST_MANDLOCK (allow mandatory locks on an FS), ST_WRITE (write on file/directory/symlink), ST_APPEND (append-only file), ST_IMMUTABLE (immutable file), ST_NOATIME (do not update access times), ST_NODIRATIME (do not update directory access times), ST_RELATIME (update atime relative to mtime/ctime). This function can support specifying a file descriptor. Availability: Unix.  Changed in version 3.2: The ST_RDONLY and ST_NOSUID constants were added.   New in version 3.3: Added support for specifying path as an open file descriptor.   Changed in version 3.4: The ST_NODEV, ST_NOEXEC, ST_SYNCHRONOUS, ST_MANDLOCK, ST_WRITE, ST_APPEND, ST_IMMUTABLE, ST_NOATIME, ST_NODIRATIME, and ST_RELATIME constants were added.   Changed in version 3.6: Accepts a path-like object.   New in version 3.7: Added f_fsid.
st_atime_ns  
Time of most recent access expressed in nanoseconds as an integer.
st_blksize  
“Preferred” blocksize for efficient file system I/O. Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.
st_blocks  
Number of 512-byte blocks allocated for file. This may be smaller than st_size/512 when the file has holes.
st_ctime  
Platform dependent:  the time of most recent metadata change on Unix, the time of creation on Windows, expressed in seconds.
st_ctime_ns  
Platform dependent:  the time of most recent metadata change on Unix, the time of creation on Windows, expressed in nanoseconds as an integer.
st_file_attributes  
Windows file attributes: dwFileAttributes member of the BY_HANDLE_FILE_INFORMATION structure returned by GetFileInformationByHandle(). See the FILE_ATTRIBUTE_* constants in the stat module.
st_fstype  
String that uniquely identifies the type of the filesystem that contains the file.
st_ino  
Platform dependent, but if non-zero, uniquely identifies the file for a given value of st_dev. Typically:  the inode number on Unix, the file index on Windows
st_mtime_ns  
Time of most recent content modification expressed in nanoseconds as an integer.