neulab/docprompting-conala huggingface dataset:
os.path.getsize(path)  
Return the size, in bytes, of path. Raise OSError if the file does not exist or is inaccessible.  Changed in version 3.6: Accepts a path-like object.
os.path.isabs(path)  
Return True if path is an absolute pathname. On Unix, that means it begins with a slash, on Windows that it begins with a (back)slash after chopping off a potential drive letter.  Changed in version 3.6: Accepts a path-like object.
os.path.isdir(path)  
Return True if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path.  Changed in version 3.6: Accepts a path-like object.
os.path.isfile(path)  
Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.  Changed in version 3.6: Accepts a path-like object.
os.path.islink(path)  
Return True if path refers to an existing directory entry that is a symbolic link. Always False if symbolic links are not supported by the Python runtime.  Changed in version 3.6: Accepts a path-like object.
os.path.ismount(path)  
Return True if pathname path is a mount point: a point in a file system where a different file system has been mounted. On POSIX, the function checks whether path’s parent, path/.., is on a different device than path, or whether path/.. and path point to the same i-node on the same device — this should detect mount points for all Unix and POSIX variants. It is not able to reliably detect bind mounts on the same filesystem. On Windows, a drive letter root and a share UNC are always mount points, and for any other path GetVolumePathName is called to see if it is different from the input path.  New in version 3.4: Support for detecting non-root mount points on Windows.   Changed in version 3.6: Accepts a path-like object.
os.path.join(path, *paths)  
Join one or more path components intelligently. The return value is the concatenation of path and any members of *paths with exactly one directory separator following each non-empty part except the last, meaning that the result will only end in a separator if the last part is empty. If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., r'\foo') is encountered. If a component contains a drive letter, all previous components are thrown away and the drive letter is reset. Note that since there is a current directory for each drive, os.path.join("c:", "foo") represents a path relative to the current directory on drive C: (c:foo), not c:\foo.  Changed in version 3.6: Accepts a path-like object for path and paths.
os.path.lexists(path)  
Return True if path refers to an existing path. Returns True for broken symbolic links. Equivalent to exists() on platforms lacking os.lstat().  Changed in version 3.6: Accepts a path-like object.
os.path.normcase(path)  
Normalize the case of a pathname. On Windows, convert all characters in the pathname to lowercase, and also convert forward slashes to backward slashes. On other operating systems, return the path unchanged.  Changed in version 3.6: Accepts a path-like object.
os.path.normpath(path)  
Normalize a pathname by collapsing redundant separators and up-level references so that A//B, A/B/, A/./B and A/foo/../B all become A/B. This string manipulation may change the meaning of a path that contains symbolic links. On Windows, it converts forward slashes to backward slashes. To normalize case, use normcase().  Changed in version 3.6: Accepts a path-like object.
os.path.realpath(path)  
Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path (if they are supported by the operating system).  Note When symbolic link cycles occur, the returned path will be one member of the cycle, but no guarantee is made about which member that will be.   Changed in version 3.6: Accepts a path-like object.   Changed in version 3.8: Symbolic links and junctions are now resolved on Windows.
os.path.relpath(path, start=os.curdir)  
Return a relative filepath to path either from the current directory or from an optional start directory. This is a path computation: the filesystem is not accessed to confirm the existence or nature of path or start. On Windows, ValueError is raised when path and start are on different drives. start defaults to os.curdir. Availability: Unix, Windows.  Changed in version 3.6: Accepts a path-like object.
os.path.samefile(path1, path2)  
Return True if both pathname arguments refer to the same file or directory. This is determined by the device number and i-node number and raises an exception if an os.stat() call on either pathname fails. Availability: Unix, Windows.  Changed in version 3.2: Added Windows support.   Changed in version 3.4: Windows now uses the same implementation as all other platforms.   Changed in version 3.6: Accepts a path-like object.
os.path.sameopenfile(fp1, fp2)  
Return True if the file descriptors fp1 and fp2 refer to the same file. Availability: Unix, Windows.  Changed in version 3.2: Added Windows support.   Changed in version 3.6: Accepts a path-like object.
os.path.samestat(stat1, stat2)  
Return True if the stat tuples stat1 and stat2 refer to the same file. These structures may have been returned by os.fstat(), os.lstat(), or os.stat(). This function implements the underlying comparison used by samefile() and sameopenfile(). Availability: Unix, Windows.  Changed in version 3.4: Added Windows support.   Changed in version 3.6: Accepts a path-like object.
os.path.split(path)  
Split the pathname path into a pair, (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash; if path ends in a slash, tail will be empty. If there is no slash in path, head will be empty. If path is empty, both head and tail are empty. Trailing slashes are stripped from head unless it is the root (one or more slashes only). In all cases, join(head, tail) returns a path to the same location as path (but the strings may differ). Also see the functions dirname() and basename().  Changed in version 3.6: Accepts a path-like object.
os.path.splitdrive(path)  
Split the pathname path into a pair (drive, tail) where drive is either a mount point or the empty string. On systems which do not use drive specifications, drive will always be the empty string. In all cases, drive
+ tail will be the same as path. On Windows, splits a pathname into drive/UNC sharepoint and relative path. If the path contains a drive letter, drive will contain everything up to and including the colon. e.g. splitdrive("c:/dir") returns ("c:", "/dir") If the path contains a UNC path, drive will contain the host name and share, up to but not including the fourth separator. e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")  Changed in version 3.6: Accepts a path-like object.
os.path.splitext(path)  
Split the pathname path into a pair (root, ext) such that root + ext ==
path, and ext is empty or begins with a period and contains at most one period. Leading periods on the basename are ignored; splitext('.cshrc') returns ('.cshrc', '').  Changed in version 3.6: Accepts a path-like object.
os.path.supports_unicode_filenames  
True if arbitrary Unicode strings can be used as file names (within limitations imposed by the file system).
os.pathconf(path, name)  
Return system configuration information relevant to a named file. name specifies the configuration value to retrieve; it may be a string which is the name of a defined system value; these names are specified in a number of standards (POSIX.1, Unix 95, Unix 98, and others). Some platforms define additional names as well. The names known to the host operating system are given in the pathconf_names dictionary. For configuration variables not included in that mapping, passing an integer for name is also accepted. If name is a string and is not known, ValueError is raised. If a specific value for name is not supported by the host system, even if it is included in pathconf_names, an OSError is raised with errno.EINVAL for the error number. This function can support specifying a file descriptor. Availability: Unix.  Changed in version 3.6: Accepts a path-like object.
os.pathconf_names  
Dictionary mapping names accepted by pathconf() and fpathconf() to the integer values defined for those names by the host operating system. This can be used to determine the set of names known to the system. Availability: Unix.
class os.PathLike  
An abstract base class for objects representing a file system path, e.g. pathlib.PurePath.  New in version 3.6.   
abstractmethod __fspath__()  
Return the file system path representation of the object. The method should only return a str or bytes object, with the preference being for str.
abstractmethod __fspath__()  
Return the file system path representation of the object. The method should only return a str or bytes object, with the preference being for str.
os.pathsep  
The character conventionally used by the operating system to separate search path components (as in PATH), such as ':' for POSIX or ';' for Windows. Also available via os.path.
os.pidfd_open(pid, flags=0)  
Return a file descriptor referring to the process pid. This descriptor can be used to perform process management without races and signals. The flags argument is provided for future extensions; no flag values are currently defined. See the pidfd_open(2) man page for more details. Availability: Linux 5.3+  New in version 3.9.
os.pipe()  
Create a pipe. Return a pair of file descriptors (r, w) usable for reading and writing, respectively. The new file descriptor is non-inheritable. Availability: Unix, Windows.  Changed in version 3.4: The new file descriptors are now non-inheritable.
os.pipe2(flags)  
Create a pipe with flags set atomically. flags can be constructed by ORing together one or more of these values: O_NONBLOCK, O_CLOEXEC. Return a pair of file descriptors (r, w) usable for reading and writing, respectively. Availability: some flavors of Unix.  New in version 3.3.
os.plock(op)  
Lock program segments into memory. The value of op (defined in <sys/lock.h>) determines which segments are locked. Availability: Unix.
os.popen(cmd, mode='r', buffering=-1)  
Open a pipe to or from command cmd. The return value is an open file object connected to the pipe, which can be read or written depending on whether mode is 'r' (default) or 'w'. The buffering argument has the same meaning as the corresponding argument to the built-in open() function. The returned file object reads or writes text strings rather than bytes. The close method returns None if the subprocess exited successfully, or the subprocess’s return code if there was an error. On POSIX systems, if the return code is positive it represents the return value of the process left-shifted by one byte. If the return code is negative, the process was terminated by the signal given by the negated value of the return code. (For example, the return value might be - signal.SIGKILL if the subprocess was killed.) On Windows systems, the return value contains the signed integer return code from the child process. On Unix, waitstatus_to_exitcode() can be used to convert the close method result (exit status) into an exit code if it is not None. On Windows, the close method result is directly the exit code (or None). This is implemented using subprocess.Popen; see that class’s documentation for more powerful ways to manage and communicate with subprocesses.
os.posix_fadvise(fd, offset, len, advice)  
Announces an intention to access data in a specific pattern thus allowing the kernel to make optimizations. The advice applies to the region of the file specified by fd starting at offset and continuing for len bytes. advice is one of POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL, POSIX_FADV_RANDOM, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED or POSIX_FADV_DONTNEED. Availability: Unix.  New in version 3.3.
os.POSIX_FADV_NORMAL  
os.POSIX_FADV_SEQUENTIAL  
os.POSIX_FADV_RANDOM  
os.POSIX_FADV_NOREUSE  
os.POSIX_FADV_WILLNEED  
os.POSIX_FADV_DONTNEED  
Flags that can be used in advice in posix_fadvise() that specify the access pattern that is likely to be used. Availability: Unix.  New in version 3.3.
os.posix_fallocate(fd, offset, len)  
Ensures that enough disk space is allocated for the file specified by fd starting from offset and continuing for len bytes. Availability: Unix.  New in version 3.3.
os.posix_spawn(path, argv, env, *, file_actions=None, setpgroup=None, resetids=False, setsid=False, setsigmask=(), setsigdef=(), scheduler=None)  
Wraps the posix_spawn() C library API for use from Python. Most users should use subprocess.run() instead of posix_spawn(). The positional-only arguments path, args, and env are similar to execve(). The path parameter is the path to the executable file. The path should contain a directory. Use posix_spawnp() to pass an executable file without directory. The file_actions argument may be a sequence of tuples describing actions to take on specific file descriptors in the child process between the C library implementation’s fork() and exec() steps. The first item in each tuple must be one of the three type indicator listed below describing the remaining tuple elements:  
os.POSIX_SPAWN_OPEN  
(os.POSIX_SPAWN_OPEN, fd, path, flags, mode) Performs os.dup2(os.open(path, flags, mode), fd). 
  
os.POSIX_SPAWN_CLOSE  
(os.POSIX_SPAWN_CLOSE, fd) Performs os.close(fd). 
  
os.POSIX_SPAWN_DUP2  
(os.POSIX_SPAWN_DUP2, fd, new_fd) Performs os.dup2(fd, new_fd). 
 These tuples correspond to the C library posix_spawn_file_actions_addopen(), posix_spawn_file_actions_addclose(), and posix_spawn_file_actions_adddup2() API calls used to prepare for the posix_spawn() call itself. The setpgroup argument will set the process group of the child to the value specified. If the value specified is 0, the child’s process group ID will be made the same as its process ID. If the value of setpgroup is not set, the child will inherit the parent’s process group ID. This argument corresponds to the C library POSIX_SPAWN_SETPGROUP flag. If the resetids argument is True it will reset the effective UID and GID of the child to the real UID and GID of the parent process. If the argument is False, then the child retains the effective UID and GID of the parent. In either case, if the set-user-ID and set-group-ID permission bits are enabled on the executable file, their effect will override the setting of the effective UID and GID. This argument corresponds to the C library POSIX_SPAWN_RESETIDS flag. If the setsid argument is True, it will create a new session ID for posix_spawn. setsid requires POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP flag. Otherwise, NotImplementedError is raised. The setsigmask argument will set the signal mask to the signal set specified. If the parameter is not used, then the child inherits the parent’s signal mask. This argument corresponds to the C library POSIX_SPAWN_SETSIGMASK flag. The sigdef argument will reset the disposition of all signals in the set specified. This argument corresponds to the C library POSIX_SPAWN_SETSIGDEF flag. The scheduler argument must be a tuple containing the (optional) scheduler policy and an instance of sched_param with the scheduler parameters. A value of None in the place of the scheduler policy indicates that is not being provided. This argument is a combination of the C library POSIX_SPAWN_SETSCHEDPARAM and POSIX_SPAWN_SETSCHEDULER flags. Raises an auditing event os.posix_spawn with arguments path, argv, env.  New in version 3.8.  Availability: Unix.
os.posix_spawnp(path, argv, env, *, file_actions=None, setpgroup=None, resetids=False, setsid=False, setsigmask=(), setsigdef=(), scheduler=None)  
Wraps the posix_spawnp() C library API for use from Python. Similar to posix_spawn() except that the system searches for the executable file in the list of directories specified by the PATH environment variable (in the same way as for execvp(3)). Raises an auditing event os.posix_spawn with arguments path, argv, env.  New in version 3.8.  Availability: See posix_spawn() documentation.
os.POSIX_SPAWN_CLOSE  
(os.POSIX_SPAWN_CLOSE, fd) Performs os.close(fd).
os.POSIX_SPAWN_DUP2  
(os.POSIX_SPAWN_DUP2, fd, new_fd) Performs os.dup2(fd, new_fd).
os.POSIX_SPAWN_OPEN  
(os.POSIX_SPAWN_OPEN, fd, path, flags, mode) Performs os.dup2(os.open(path, flags, mode), fd).
os.pread(fd, n, offset)  
Read at most n bytes from file descriptor fd at a position of offset, leaving the file offset unchanged. Return a bytestring containing the bytes read. If the end of the file referred to by fd has been reached, an empty bytes object is returned. Availability: Unix.  New in version 3.3.
os.preadv(fd, buffers, offset, flags=0)  
Read from a file descriptor fd at a position of offset into mutable bytes-like objects buffers, leaving the file offset unchanged. Transfer data into each buffer until it is full and then move on to the next buffer in the sequence to hold the rest of the data. The flags argument contains a bitwise OR of zero or more of the following flags:  RWF_HIPRI RWF_NOWAIT  Return the total number of bytes actually read which can be less than the total capacity of all the objects. The operating system may set a limit (sysconf() value 'SC_IOV_MAX') on the number of buffers that can be used. Combine the functionality of os.readv() and os.pread(). Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux 4.6 or newer.  New in version 3.7.
os.PRIO_PROCESS  
os.PRIO_PGRP  
os.PRIO_USER  
Parameters for the getpriority() and setpriority() functions. Availability: Unix.  New in version 3.3.
os.putenv(key, value)  
Set the environment variable named key to the string value. Such changes to the environment affect subprocesses started with os.system(), popen() or fork() and execv(). Assignments to items in os.environ are automatically translated into corresponding calls to putenv(); however, calls to putenv() don’t update os.environ, so it is actually preferable to assign to items of os.environ.  Note On some platforms, including FreeBSD and Mac OS X, setting environ may cause memory leaks. Refer to the system documentation for putenv().  Raises an auditing event os.putenv with arguments key, value.  Changed in version 3.9: The function is now always available.
os.pwrite(fd, str, offset)  
Write the bytestring in str to file descriptor fd at position of offset, leaving the file offset unchanged. Return the number of bytes actually written. Availability: Unix.  New in version 3.3.
os.pwritev(fd, buffers, offset, flags=0)  
Write the buffers contents to file descriptor fd at a offset offset, leaving the file offset unchanged. buffers must be a sequence of bytes-like objects. Buffers are processed in array order. Entire contents of the first buffer is written before proceeding to the second, and so on. The flags argument contains a bitwise OR of zero or more of the following flags:  RWF_DSYNC RWF_SYNC  Return the total number of bytes actually written. The operating system may set a limit (sysconf() value 'SC_IOV_MAX') on the number of buffers that can be used. Combine the functionality of os.writev() and os.pwrite(). Availability: Linux 2.6.30 and newer, FreeBSD 6.0 and newer, OpenBSD 2.7 and newer, AIX 7.1 and newer. Using flags requires Linux 4.7 or newer.  New in version 3.7.
os.P_PID  
os.P_PGID  
os.P_ALL  
These are the possible values for idtype in waitid(). They affect how id is interpreted. Availability: Unix.  New in version 3.3.
os.P_DETACH  
os.P_OVERLAY  
Possible values for the mode parameter to the spawn* family of functions. These are less portable than those listed above. P_DETACH is similar to P_NOWAIT, but the new process is detached from the console of the calling process. If P_OVERLAY is used, the current process will be replaced; the spawn* function will not return. Availability: Windows.
os.P_NOWAIT  
os.P_NOWAITO  
Possible values for the mode parameter to the spawn* family of functions. If either of these values is given, the spawn*() functions will return as soon as the new process has been created, with the process id as the return value. Availability: Unix, Windows.
os.P_PIDFD  
This is a Linux-specific idtype that indicates that id is a file descriptor that refers to a process. Availability: Linux 5.4+  New in version 3.9.
os.P_WAIT  
Possible value for the mode parameter to the spawn* family of functions. If this is given as mode, the spawn*() functions will not return until the new process has run to completion and will return the exit code of the process the run is successful, or -signal if a signal kills the process. Availability: Unix, Windows.
os.read(fd, n)  
Read at most n bytes from file descriptor fd. Return a bytestring containing the bytes read. If the end of the file referred to by fd has been reached, an empty bytes object is returned.  Note This function is intended for low-level I/O and must be applied to a file descriptor as returned by os.open() or pipe(). To read a “file object” returned by the built-in function open() or by popen() or fdopen(), or sys.stdin, use its read() or readline() methods.   Changed in version 3.5: If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an InterruptedError exception (see PEP 475 for the rationale).
os.readlink(path, *, dir_fd=None)  
Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname; if it is relative, it may be converted to an absolute pathname using os.path.join(os.path.dirname(path), result). If the path is a string object (directly or indirectly through a PathLike interface), the result will also be a string object, and the call may raise a UnicodeDecodeError. If the path is a bytes object (direct or indirectly), the result will be a bytes object. This function can also support paths relative to directory descriptors. When trying to resolve a path that may contain links, use realpath() to properly handle recursion and platform differences. Availability: Unix, Windows.  Changed in version 3.2: Added support for Windows 6.0 (Vista) symbolic links.   New in version 3.3: The dir_fd argument.   Changed in version 3.6: Accepts a path-like object on Unix.   Changed in version 3.8: Accepts a path-like object and a bytes object on Windows.   Changed in version 3.8: Added support for directory junctions, and changed to return the substitution path (which typically includes \\?\ prefix) rather than the optional “print name” field that was previously returned.
os.readv(fd, buffers)  
Read from a file descriptor fd into a number of mutable bytes-like objects buffers. Transfer data into each buffer until it is full and then move on to the next buffer in the sequence to hold the rest of the data. Return the total number of bytes actually read which can be less than the total capacity of all the objects. The operating system may set a limit (sysconf() value 'SC_IOV_MAX') on the number of buffers that can be used. Availability: Unix.  New in version 3.3.