neulab/docprompting-conala huggingface dataset:
Path.is_symlink()  
Return True if the path points to a symbolic link, False otherwise. False is also returned if the path doesn’t exist; other errors (such as permission errors) are propagated.
Path.iterdir()  
When the path points to a directory, yield path objects of the directory contents: >>> p = Path('docs')
>>> for child in p.iterdir(): child
...
PosixPath('docs/conf.py')
PosixPath('docs/_templates')
PosixPath('docs/make.bat')
PosixPath('docs/index.rst')
PosixPath('docs/_build')
PosixPath('docs/_static')
PosixPath('docs/Makefile')
 The children 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 path object for that file be included is unspecified.
Path.lchmod(mode)  
Like Path.chmod() but, if the path points to a symbolic link, the symbolic link’s mode is changed rather than its target’s.
Path.link_to(target)  
Make target a hard link to this path.  Warning This function does not make this path a hard link to target, despite the implication of the function and argument names. The argument order (target, link) is the reverse of Path.symlink_to(), but matches that of os.link().   New in version 3.8.
Path.lstat()  
Like Path.stat() but, if the path points to a symbolic link, return the symbolic link’s information rather than its target’s.
Path.mkdir(mode=0o777, parents=False, exist_ok=False)  
Create a new directory at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the path already exists, FileExistsError is raised. If parents is true, any missing parents of this path are created as needed; they are created with the default permissions without taking mode into account (mimicking the POSIX mkdir -p command). If parents is false (the default), a missing parent raises FileNotFoundError. If exist_ok is false (the default), FileExistsError is raised if the target directory already exists. If exist_ok is true, FileExistsError exceptions will be ignored (same behavior as the POSIX mkdir -p command), but only if the last path component is not an existing non-directory file.  Changed in version 3.5: The exist_ok parameter was added.
Path.open(mode='r', buffering=-1, encoding=None, errors=None, newline=None)  
Open the file pointed to by the path, like the built-in open() function does: >>> p = Path('setup.py')
>>> with p.open() as f:
...     f.readline()
...
'#!/usr/bin/env python3\n'
Path.owner()  
Return the name of the user owning the file. KeyError is raised if the file’s uid isn’t found in the system database.
Path.readlink()  
Return the path to which the symbolic link points (as returned by os.readlink()): >>> p = Path('mylink')
>>> p.symlink_to('setup.py')
>>> p.readlink()
PosixPath('setup.py')
  New in version 3.9.
Path.read_bytes()  
Return the binary contents of the pointed-to file as a bytes object: >>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents'
  New in version 3.5.
Path.read_text(encoding=None, errors=None)  
Return the decoded contents of the pointed-to file as a string: >>> p = Path('my_text_file')
>>> p.write_text('Text file contents')
18
>>> p.read_text()
'Text file contents'
 The file is opened and then closed. The optional parameters have the same meaning as in open().  New in version 3.5.
Path.rename(target)  
Rename this file or directory to the given target, and return a new Path instance pointing to target. On Unix, if target exists and is a file, it will be replaced silently if the user has permission. target can be either a string or another path object: >>> p = Path('foo')
>>> p.open('w').write('some text')
9
>>> target = Path('bar')
>>> p.rename(target)
PosixPath('bar')
>>> target.open().read()
'some text'
 The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, not the directory of the Path object.  Changed in version 3.8: Added return value, return the new Path instance.
Path.replace(target)  
Rename this file or directory to the given target, and return a new Path instance pointing to target. If target points to an existing file or directory, it will be unconditionally replaced. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, not the directory of the Path object.  Changed in version 3.8: Added return value, return the new Path instance.
Path.resolve(strict=False)  
Make the path absolute, resolving any symlinks. A new path object is returned: >>> p = Path()
>>> p
PosixPath('.')
>>> p.resolve()
PosixPath('/home/antoine/pathlib')
 “..” components are also eliminated (this is the only method to do so): >>> p = Path('docs/../setup.py')
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')
 If the path doesn’t exist and strict is True, FileNotFoundError is raised. If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. If an infinite loop is encountered along the resolution path, RuntimeError is raised.  New in version 3.6: The strict argument (pre-3.6 behavior is strict).
Path.rglob(pattern)  
This is like calling Path.glob() with “**/” added in front of the given relative pattern: >>> sorted(Path().rglob("*.py"))
[PosixPath('build/lib/pathlib.py'),
 PosixPath('docs/conf.py'),
 PosixPath('pathlib.py'),
 PosixPath('setup.py'),
 PosixPath('test_pathlib.py')]
 Raises an auditing event pathlib.Path.rglob with arguments self, pattern.
Path.samefile(other_path)  
Return whether this path points to the same file as other_path, which can be either a Path object, or a string. The semantics are similar to os.path.samefile() and os.path.samestat(). An OSError can be raised if either file cannot be accessed for some reason. >>> p = Path('spam')
>>> q = Path('eggs')
>>> p.samefile(q)
False
>>> p.samefile('spam')
True
  New in version 3.5.
Path.stat()  
Return a os.stat_result object containing information about this path, like os.stat(). The result is looked up at each call to this method. >>> p = Path('setup.py')
>>> p.stat().st_size
956
>>> p.stat().st_mtime
1327883547.852554
Path.symlink_to(target, target_is_directory=False)  
Make this path a symbolic link to target. Under Windows, target_is_directory must be true (default False) if the link’s target is a directory. Under POSIX, target_is_directory’s value is ignored. >>> p = Path('mylink')
>>> p.symlink_to('setup.py')
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')
>>> p.stat().st_size
956
>>> p.lstat().st_size
8
  Note The order of arguments (link, target) is the reverse of os.symlink()’s.
Path.touch(mode=0o666, exist_ok=True)  
Create a file at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the file already exists, the function succeeds if exist_ok is true (and its modification time is updated to the current time), otherwise FileExistsError is raised.
Path.unlink(missing_ok=False)  
Remove this file or symbolic link. If the path points to a directory, use Path.rmdir() instead. If missing_ok is false (the default), FileNotFoundError is raised if the path does not exist. If missing_ok is true, FileNotFoundError exceptions will be ignored (same behavior as the POSIX rm -f command).  Changed in version 3.8: The missing_ok parameter was added.
Path.write_bytes(data)  
Open the file pointed to in bytes mode, write data to it, and close the file: >>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents'
 An existing file of the same name is overwritten.  New in version 3.5.
Path.write_text(data, encoding=None, errors=None)  
Open the file pointed to in text mode, write data to it, and close the file: >>> p = Path('my_text_file')
>>> p.write_text('Text file contents')
18
>>> p.read_text()
'Text file contents'
 An existing file of the same name is overwritten. The optional parameters have the same meaning as in open().  New in version 3.5.
class pathlib.PosixPath(*pathsegments)  
A subclass of Path and PurePosixPath, this class represents concrete non-Windows filesystem paths: >>> PosixPath('/etc')
PosixPath('/etc')
 pathsegments is specified similarly to PurePath.
class pathlib.PurePath(*pathsegments)  
A generic class that represents the system’s path flavour (instantiating it creates either a PurePosixPath or a PureWindowsPath): >>> PurePath('setup.py')      # Running on a Unix machine
PurePosixPath('setup.py')
 Each element of pathsegments can be either a string representing a path segment, an object implementing the os.PathLike interface which returns a string, or another path object: >>> PurePath('foo', 'some/path', 'bar')
PurePosixPath('foo/some/path/bar')
>>> PurePath(Path('foo'), Path('bar'))
PurePosixPath('foo/bar')
 When pathsegments is empty, the current directory is assumed: >>> PurePath()
PurePosixPath('.')
 When several absolute paths are given, the last is taken as an anchor (mimicking os.path.join()’s behaviour): >>> PurePath('/etc', '/usr', 'lib64')
PurePosixPath('/usr/lib64')
>>> PureWindowsPath('c:/Windows', 'd:bar')
PureWindowsPath('d:bar')
 However, in a Windows path, changing the local root doesn’t discard the previous drive setting: >>> PureWindowsPath('c:/Windows', '/Program Files')
PureWindowsPath('c:/Program Files')
 Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links: >>> PurePath('foo//bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/./bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/../bar')
PurePosixPath('foo/../bar')
 (a naïve approach would make PurePosixPath('foo/../bar') equivalent to PurePosixPath('bar'), which is wrong if foo is a symbolic link to another directory) Pure path objects implement the os.PathLike interface, allowing them to be used anywhere the interface is accepted.  Changed in version 3.6: Added support for the os.PathLike interface.
PurePath.anchor  
The concatenation of the drive and root: >>> PureWindowsPath('c:/Program Files/').anchor
'c:\\'
>>> PureWindowsPath('c:Program Files/').anchor
'c:'
>>> PurePosixPath('/etc').anchor
'/'
>>> PureWindowsPath('//host/share').anchor
'\\\\host\\share\\'
PurePath.as_posix()  
Return a string representation of the path with forward slashes (/): >>> p = PureWindowsPath('c:\\windows')
>>> str(p)
'c:\\windows'
>>> p.as_posix()
'c:/windows'
PurePath.as_uri()  
Represent the path as a file URI. ValueError is raised if the path isn’t absolute. >>> p = PurePosixPath('/etc/passwd')
>>> p.as_uri()
'file:///etc/passwd'
>>> p = PureWindowsPath('c:/Windows')
>>> p.as_uri()
'file:///c:/Windows'
PurePath.drive  
A string representing the drive letter or name, if any: >>> PureWindowsPath('c:/Program Files/').drive
'c:'
>>> PureWindowsPath('/Program Files/').drive
''
>>> PurePosixPath('/etc').drive
''
 UNC shares are also considered drives: >>> PureWindowsPath('//host/share/foo.txt').drive
'\\\\host\\share'
PurePath.is_absolute()  
Return whether the path is absolute or not. A path is considered absolute if it has both a root and (if the flavour allows) a drive: >>> PurePosixPath('/a/b').is_absolute()
True
>>> PurePosixPath('a/b').is_absolute()
False

>>> PureWindowsPath('c:/a/b').is_absolute()
True
>>> PureWindowsPath('/a/b').is_absolute()
False
>>> PureWindowsPath('c:').is_absolute()
False
>>> PureWindowsPath('//some/share').is_absolute()
True
PurePath.is_relative_to(*other)  
Return whether or not this path is relative to the other path. >>> p = PurePath('/etc/passwd')
>>> p.is_relative_to('/etc')
True
>>> p.is_relative_to('/usr')
False
  New in version 3.9.
PurePath.is_reserved()  
With PureWindowsPath, return True if the path is considered reserved under Windows, False otherwise. With PurePosixPath, False is always returned. >>> PureWindowsPath('nul').is_reserved()
True
>>> PurePosixPath('nul').is_reserved()
False
 File system calls on reserved paths can fail mysteriously or have unintended effects.
PurePath.joinpath(*other)  
Calling this method is equivalent to combining the path with each of the other arguments in turn: >>> PurePosixPath('/etc').joinpath('passwd')
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath('init.d', 'apache2')
PurePosixPath('/etc/init.d/apache2')
>>> PureWindowsPath('c:').joinpath('/Program Files')
PureWindowsPath('c:/Program Files')
PurePath.match(pattern)  
Match this path against the provided glob-style pattern. Return True if matching is successful, False otherwise. If pattern is relative, the path can be either relative or absolute, and matching is done from the right: >>> PurePath('a/b.py').match('*.py')
True
>>> PurePath('/a/b/c.py').match('b/*.py')
True
>>> PurePath('/a/b/c.py').match('a/*.py')
False
 If pattern is absolute, the path must be absolute, and the whole path must match: >>> PurePath('/a.py').match('/*.py')
True
>>> PurePath('a/b.py').match('/*.py')
False
 As with other methods, case-sensitivity follows platform defaults: >>> PurePosixPath('b.py').match('*.PY')
False
>>> PureWindowsPath('b.py').match('*.PY')
True
PurePath.name  
A string representing the final path component, excluding the drive and root, if any: >>> PurePosixPath('my/library/setup.py').name
'setup.py'
 UNC drive names are not considered: >>> PureWindowsPath('//some/share/setup.py').name
'setup.py'
>>> PureWindowsPath('//some/share').name
''
PurePath.parent  
The logical parent of the path: >>> p = PurePosixPath('/a/b/c/d')
>>> p.parent
PurePosixPath('/a/b/c')
 You cannot go past an anchor, or empty path: >>> p = PurePosixPath('/')
>>> p.parent
PurePosixPath('/')
>>> p = PurePosixPath('.')
>>> p.parent
PurePosixPath('.')
  Note This is a purely lexical operation, hence the following behaviour: >>> p = PurePosixPath('foo/..')
>>> p.parent
PurePosixPath('foo')
 If you want to walk an arbitrary filesystem path upwards, it is recommended to first call Path.resolve() so as to resolve symlinks and eliminate “..” components.
PurePath.parents  
An immutable sequence providing access to the logical ancestors of the path: >>> p = PureWindowsPath('c:/foo/bar/setup.py')
>>> p.parents[0]
PureWindowsPath('c:/foo/bar')
>>> p.parents[1]
PureWindowsPath('c:/foo')
>>> p.parents[2]
PureWindowsPath('c:/')
PurePath.parts  
A tuple giving access to the path’s various components: >>> p = PurePath('/usr/bin/python3')
>>> p.parts
('/', 'usr', 'bin', 'python3')

>>> p = PureWindowsPath('c:/Program Files/PSF')
>>> p.parts
('c:\\', 'Program Files', 'PSF')
 (note how the drive and local root are regrouped in a single part)
PurePath.relative_to(*other)  
Compute a version of this path relative to the path represented by other. If it’s impossible, ValueError is raised: >>> p = PurePosixPath('/etc/passwd')
>>> p.relative_to('/')
PurePosixPath('etc/passwd')
>>> p.relative_to('/etc')
PurePosixPath('passwd')
>>> p.relative_to('/usr')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pathlib.py", line 694, in relative_to
    .format(str(self), str(formatted)))
ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is relative and the other absolute.
 NOTE: This function is part of PurePath and works with strings. It does not check or access the underlying file structure.
PurePath.root  
A string representing the (local or global) root, if any: >>> PureWindowsPath('c:/Program Files/').root
'\\'
>>> PureWindowsPath('c:Program Files/').root
''
>>> PurePosixPath('/etc').root
'/'
 UNC shares always have a root: >>> PureWindowsPath('//host/share').root
'\\'
PurePath.stem  
The final path component, without its suffix: >>> PurePosixPath('my/library.tar.gz').stem
'library.tar'
>>> PurePosixPath('my/library.tar').stem
'library'
>>> PurePosixPath('my/library').stem
'library'
PurePath.suffix  
The file extension of the final component, if any: >>> PurePosixPath('my/library/setup.py').suffix
'.py'
>>> PurePosixPath('my/library.tar.gz').suffix
'.gz'
>>> PurePosixPath('my/library').suffix
''
PurePath.suffixes  
A list of the path’s file extensions: >>> PurePosixPath('my/library.tar.gar').suffixes
['.tar', '.gar']
>>> PurePosixPath('my/library.tar.gz').suffixes
['.tar', '.gz']
>>> PurePosixPath('my/library').suffixes
[]
PurePath.with_name(name)  
Return a new path with the name changed. If the original path doesn’t have a name, ValueError is raised: >>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_name('setup.py')
PureWindowsPath('c:/Downloads/setup.py')
>>> p = PureWindowsPath('c:/')
>>> p.with_name('setup.py')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/cpython/default/Lib/pathlib.py", line 751, in with_name
    raise ValueError("%r has an empty name" % (self,))
ValueError: PureWindowsPath('c:/') has an empty name
PurePath.with_stem(stem)  
Return a new path with the stem changed. If the original path doesn’t have a name, ValueError is raised: >>> p = PureWindowsPath('c:/Downloads/draft.txt')
>>> p.with_stem('final')
PureWindowsPath('c:/Downloads/final.txt')
>>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_stem('lib')
PureWindowsPath('c:/Downloads/lib.gz')
>>> p = PureWindowsPath('c:/')
>>> p.with_stem('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/cpython/default/Lib/pathlib.py", line 861, in with_stem
    return self.with_name(stem + self.suffix)
  File "/home/antoine/cpython/default/Lib/pathlib.py", line 851, in with_name
    raise ValueError("%r has an empty name" % (self,))
ValueError: PureWindowsPath('c:/') has an empty name
  New in version 3.9.
PurePath.with_suffix(suffix)  
Return a new path with the suffix changed. If the original path doesn’t have a suffix, the new suffix is appended instead. If the suffix is an empty string, the original suffix is removed: >>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_suffix('.bz2')
PureWindowsPath('c:/Downloads/pathlib.tar.bz2')
>>> p = PureWindowsPath('README')
>>> p.with_suffix('.txt')
PureWindowsPath('README.txt')
>>> p = PureWindowsPath('README.txt')
>>> p.with_suffix('')
PureWindowsPath('README')
class pathlib.PurePosixPath(*pathsegments)  
A subclass of PurePath, this path flavour represents non-Windows filesystem paths: >>> PurePosixPath('/etc')
PurePosixPath('/etc')
 pathsegments is specified similarly to PurePath.
class pathlib.PureWindowsPath(*pathsegments)  
A subclass of PurePath, this path flavour represents Windows filesystem paths: >>> PureWindowsPath('c:/Program Files/')
PureWindowsPath('c:/Program Files')
 pathsegments is specified similarly to PurePath.
class pathlib.WindowsPath(*pathsegments)  
A subclass of Path and PureWindowsPath, this class represents concrete Windows filesystem paths: >>> WindowsPath('c:/Program Files/')
WindowsPath('c:/Program Files')
 pathsegments is specified similarly to PurePath.
class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)  
Pdb is the debugger class. The completekey, stdin and stdout arguments are passed to the underlying cmd.Cmd class; see the description there. The skip argument, if given, must be an iterable of glob-style module name patterns. The debugger will not step into frames that originate in a module that matches one of these patterns. 1 By default, Pdb sets a handler for the SIGINT signal (which is sent when the user presses Ctrl-C on the console) when you give a continue command. This allows you to break into the debugger again by pressing Ctrl-C. If you want Pdb not to touch the SIGINT handler, set nosigint to true. The readrc argument defaults to true and controls whether Pdb will load .pdbrc files from the filesystem. Example call to enable tracing with skip: import pdb; pdb.Pdb(skip=['django.*']).set_trace()
 Raises an auditing event pdb.Pdb with no arguments.  New in version 3.1: The skip argument.   New in version 3.2: The nosigint argument. Previously, a SIGINT handler was never set by Pdb.   Changed in version 3.6: The readrc argument.   
run(statement, globals=None, locals=None)  
runeval(expression, globals=None, locals=None)  
runcall(function, *args, **kwds)  
set_trace()  
See the documentation for the functions explained above.
run(statement, globals=None, locals=None)  
runeval(expression, globals=None, locals=None)  
runcall(function, *args, **kwds)  
set_trace()  
See the documentation for the functions explained above.
pdb.pm()  
Enter post-mortem debugging of the traceback found in sys.last_traceback.
pdb.post_mortem(traceback=None)  
Enter post-mortem debugging of the given traceback object. If no traceback is given, it uses the one of the exception that is currently being handled (an exception must be being handled if the default is to be used).
pdb.run(statement, globals=None, locals=None)  
Execute the statement (given as a string or a code object) under debugger control. The debugger prompt appears before any code is executed; you can set breakpoints and type continue, or you can step through the statement using step or next (all these commands are explained below). The optional globals and locals arguments specify the environment in which the code is executed; by default the dictionary of the module __main__ is used. (See the explanation of the built-in exec() or eval() functions.)
pdb.runcall(function, *args, **kwds)  
Call the function (a function or method object, not a string) with the given arguments. When runcall() returns, it returns whatever the function call returned. The debugger prompt appears as soon as the function is entered.
pdb.runeval(expression, globals=None, locals=None)  
Evaluate the expression (given as a string or a code object) under debugger control. When runeval() returns, it returns the value of the expression. Otherwise this function is similar to run().
pdb.set_trace(*, header=None)  
Enter the debugger at the calling stack frame. This is useful to hard-code a breakpoint at a given point in a program, even if the code is not otherwise being debugged (e.g. when an assertion fails). If given, header is printed to the console just before debugging begins.  Changed in version 3.7: The keyword-only argument header.
exception PendingDeprecationWarning  
Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment. This class is rarely used as emitting a warning about a possible upcoming deprecation is unusual, and DeprecationWarning is preferred for already active deprecations. Ignored by the default warning filters. Enabling the Python Development Mode shows this warning.
exception PermissionError  
Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to errno EACCES and EPERM.
pickle.DEFAULT_PROTOCOL  
An integer, the default protocol version used for pickling. May be less than HIGHEST_PROTOCOL. Currently the default protocol is 4, first introduced in Python 3.4 and incompatible with previous versions.  Changed in version 3.0: The default protocol is 3.   Changed in version 3.8: The default protocol is 4.
pickle.dump(obj, file, protocol=None, *, fix_imports=True, buffer_callback=None)  
Write the pickled representation of the object obj to the open file object file. This is equivalent to Pickler(file, protocol).dump(obj). Arguments file, protocol, fix_imports and buffer_callback have the same meaning as in the Pickler constructor.  Changed in version 3.8: The buffer_callback argument was added.
pickle.dumps(obj, protocol=None, *, fix_imports=True, buffer_callback=None)  
Return the pickled representation of the object obj as a bytes object, instead of writing it to a file. Arguments protocol, fix_imports and buffer_callback have the same meaning as in the Pickler constructor.  Changed in version 3.8: The buffer_callback argument was added.
pickle.HIGHEST_PROTOCOL  
An integer, the highest protocol version available. This value can be passed as a protocol value to functions dump() and dumps() as well as the Pickler constructor.