neulab/docprompting-conala huggingface dataset:
exception OSError([arg])  
exception OSError(errno, strerror[, filename[, winerror[, filename2]]])  
This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (not for illegal argument types or other incidental errors). The second form of the constructor sets the corresponding attributes, described below. The attributes default to None if not specified. For backwards compatibility, if three arguments are passed, the args attribute contains only a 2-tuple of the first two constructor arguments. The constructor often actually returns a subclass of OSError, as described in OS exceptions below. The particular subclass depends on the final errno value. This behaviour only occurs when constructing OSError directly or via an alias, and is not inherited when subclassing.  
errno  
A numeric error code from the C variable errno. 
  
winerror  
Under Windows, this gives you the native Windows error code. The errno attribute is then an approximate translation, in POSIX terms, of that native error code. Under Windows, if the winerror constructor argument is an integer, the errno attribute is determined from the Windows error code, and the errno argument is ignored. On other platforms, the winerror argument is ignored, and the winerror attribute does not exist. 
  
strerror  
The corresponding error message, as provided by the operating system. It is formatted by the C functions perror() under POSIX, and FormatMessage() under Windows. 
  
filename  
filename2  
For exceptions that involve a file system path (such as open() or os.unlink()), filename is the file name passed to the function. For functions that involve two file system paths (such as os.rename()), filename2 corresponds to the second file name passed to the function. 
  Changed in version 3.3: EnvironmentError, IOError, WindowsError, socket.error, select.error and mmap.error have been merged into OSError, and the constructor may return a subclass.   Changed in version 3.4: The filename attribute is now the original file name passed to the function, instead of the name encoded to or decoded from the filesystem encoding. Also, the filename2 constructor argument and attribute was added.
filename  
filename2  
For exceptions that involve a file system path (such as open() or os.unlink()), filename is the file name passed to the function. For functions that involve two file system paths (such as os.rename()), filename2 corresponds to the second file name passed to the function.
strerror  
The corresponding error message, as provided by the operating system. It is formatted by the C functions perror() under POSIX, and FormatMessage() under Windows.
winerror  
Under Windows, this gives you the native Windows error code. The errno attribute is then an approximate translation, in POSIX terms, of that native error code. Under Windows, if the winerror constructor argument is an integer, the errno attribute is determined from the Windows error code, and the errno argument is ignored. On other platforms, the winerror argument is ignored, and the winerror attribute does not exist.
ossaudiodev.open(mode)  
ossaudiodev.open(device, mode)  
Open an audio device and return an OSS audio device object. This object supports many file-like methods, such as read(), write(), and fileno() (although there are subtle differences between conventional Unix read/write semantics and those of OSS audio devices). It also supports a number of audio-specific methods; see below for the complete list of methods. device is the audio device filename to use. If it is not specified, this module first looks in the environment variable AUDIODEV for a device to use. If not found, it falls back to /dev/dsp. mode is one of 'r' for read-only (record) access, 'w' for write-only (playback) access and 'rw' for both. Since many sound cards only allow one process to have the recorder or player open at a time, it is a good idea to open the device only for the activity needed. Further, some sound cards are half-duplex: they can be opened for reading or writing, but not both at once. Note the unusual calling syntax: the first argument is optional, and the second is required. This is a historical artifact for compatibility with the older linuxaudiodev module which ossaudiodev supersedes.
ossaudiodev.openmixer([device])  
Open a mixer device and return an OSS mixer device object. device is the mixer device filename to use. If it is not specified, this module first looks in the environment variable MIXERDEV for a device to use. If not found, it falls back to /dev/mixer.
exception ossaudiodev.OSSAudioError  
This exception is raised on certain errors. The argument is a string describing what went wrong. (If ossaudiodev receives an error from a system call such as open(), write(), or ioctl(), it raises OSError. Errors detected directly by ossaudiodev result in OSSAudioError.) (For backwards compatibility, the exception class is also available as ossaudiodev.error.)
oss_audio_device.bufsize()  
Returns the size of the hardware buffer, in samples.
oss_audio_device.channels(nchannels)  
Set the number of output channels to nchannels. A value of 1 indicates monophonic sound, 2 stereophonic. Some devices may have more than 2 channels, and some high-end devices may not support mono. Returns the number of channels the device was set to.
oss_audio_device.close()  
Explicitly close the audio device. When you are done writing to or reading from an audio device, you should explicitly close it. A closed device cannot be used again.
oss_audio_device.fileno()  
Return the file descriptor associated with the device.
oss_audio_device.getfmts()  
Return a bitmask of the audio output formats supported by the soundcard. Some of the formats supported by OSS are:   
Format Description   
AFMT_MU_LAW a logarithmic encoding (used by Sun .au files and /dev/audio)  
AFMT_A_LAW a logarithmic encoding  
AFMT_IMA_ADPCM a 4:1 compressed format defined by the Interactive Multimedia Association  
AFMT_U8 Unsigned, 8-bit audio  
AFMT_S16_LE Signed, 16-bit audio, little-endian byte order (as used by Intel processors)  
AFMT_S16_BE Signed, 16-bit audio, big-endian byte order (as used by 68k, PowerPC, Sparc)  
AFMT_S8 Signed, 8 bit audio  
AFMT_U16_LE Unsigned, 16-bit little-endian audio  
AFMT_U16_BE Unsigned, 16-bit big-endian audio   Consult the OSS documentation for a full list of audio formats, and note that most devices support only a subset of these formats. Some older devices only support AFMT_U8; the most common format used today is AFMT_S16_LE.
oss_audio_device.mode  
The I/O mode for the file, either "r", "rw", or "w".
oss_audio_device.nonblock()  
Put the device into non-blocking mode. Once in non-blocking mode, there is no way to return it to blocking mode.
oss_audio_device.obufcount()  
Returns the number of samples that are in the hardware buffer yet to be played.
oss_audio_device.obuffree()  
Returns the number of samples that could be queued into the hardware buffer to be played without blocking.
oss_audio_device.post()  
Tell the driver that there is likely to be a pause in the output, making it possible for the device to handle the pause more intelligently. You might use this after playing a spot sound effect, before waiting for user input, or before doing disk I/O.
oss_audio_device.read(size)  
Read size bytes from the audio input and return them as a Python string. Unlike most Unix device drivers, OSS audio devices in blocking mode (the default) will block read() until the entire requested amount of data is available.
oss_audio_device.reset()  
Immediately stop playing or recording and return the device to a state where it can accept commands. The OSS documentation recommends closing and re-opening the device after calling reset().
oss_audio_device.setfmt(format)  
Try to set the current audio format to format—see getfmts() for a list. Returns the audio format that the device was set to, which may not be the requested format. May also be used to return the current audio format—do this by passing an “audio format” of AFMT_QUERY.
oss_audio_device.setparameters(format, nchannels, samplerate[, strict=False])  
Set the key audio sampling parameters—sample format, number of channels, and sampling rate—in one method call. format, nchannels, and samplerate should be as specified in the setfmt(), channels(), and speed() methods. If strict is true, setparameters() checks to see if each parameter was actually set to the requested value, and raises OSSAudioError if not. Returns a tuple (format, nchannels, samplerate) indicating the parameter values that were actually set by the device driver (i.e., the same as the return values of setfmt(), channels(), and speed()). For example, (fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)
 is equivalent to fmt = dsp.setfmt(fmt)
channels = dsp.channels(channels)
rate = dsp.rate(rate)
oss_audio_device.speed(samplerate)  
Try to set the audio sampling rate to samplerate samples per second. Returns the rate actually set. Most sound devices don’t support arbitrary sampling rates. Common rates are:   
Rate Description   
8000 default rate for /dev/audio  
11025 speech recording  
22050   
44100 CD quality audio (at 16 bits/sample and 2 channels)  
96000 DVD quality audio (at 24 bits/sample)
oss_audio_device.sync()  
Wait until the sound device has played every byte in its buffer. (This happens implicitly when the device is closed.) The OSS documentation recommends closing and re-opening the device rather than using sync().
oss_audio_device.write(data)  
Write a bytes-like object data to the audio device and return the number of bytes written. If the audio device is in blocking mode (the default), the entire data is always written (again, this is different from usual Unix device semantics). If the device is in non-blocking mode, some data may not be written—see writeall().  Changed in version 3.5: Writable bytes-like object is now accepted.
oss_audio_device.writeall(data)  
Write a bytes-like object data to the audio device: waits until the audio device is able to accept data, writes as much data as it will accept, and repeats until data has been completely written. If the device is in blocking mode (the default), this has the same effect as write(); writeall() is only useful in non-blocking mode. Has no return value, since the amount of data written is always equal to the amount of data supplied.  Changed in version 3.5: Writable bytes-like object is now accepted.
oss_mixer_device.close()  
This method closes the open mixer device file. Any further attempts to use the mixer after this file is closed will raise an OSError.
oss_mixer_device.controls()  
This method returns a bitmask specifying the available mixer controls (“Control” being a specific mixable “channel”, such as SOUND_MIXER_PCM or SOUND_MIXER_SYNTH). This bitmask indicates a subset of all available mixer controls—the SOUND_MIXER_* constants defined at module level. To determine if, for example, the current mixer object supports a PCM mixer, use the following Python code: mixer=ossaudiodev.openmixer()
if mixer.controls() & (1 << ossaudiodev.SOUND_MIXER_PCM):
    # PCM is supported
    ... code ...
 For most purposes, the SOUND_MIXER_VOLUME (master volume) and SOUND_MIXER_PCM controls should suffice—but code that uses the mixer should be flexible when it comes to choosing mixer controls. On the Gravis Ultrasound, for example, SOUND_MIXER_VOLUME does not exist.
oss_mixer_device.fileno()  
Returns the file handle number of the open mixer device file.
oss_mixer_device.get(control)  
Returns the volume of a given mixer control. The returned volume is a 2-tuple (left_volume,right_volume). Volumes are specified as numbers from 0 (silent) to 100 (full volume). If the control is monophonic, a 2-tuple is still returned, but both volumes are the same. Raises OSSAudioError if an invalid control is specified, or OSError if an unsupported control is specified.
oss_mixer_device.get_recsrc()  
This method returns a bitmask indicating which control(s) are currently being used as a recording source.
oss_mixer_device.reccontrols()  
Returns a bitmask specifying the mixer controls that may be used to record. See the code example for controls() for an example of reading from a bitmask.
oss_mixer_device.set(control, (left, right))  
Sets the volume for a given mixer control to (left,right). left and right must be ints and between 0 (silent) and 100 (full volume). On success, the new volume is returned as a 2-tuple. Note that this may not be exactly the same as the volume specified, because of the limited resolution of some soundcard’s mixers. Raises OSSAudioError if an invalid mixer control was specified, or if the specified volumes were out-of-range.
oss_mixer_device.set_recsrc(bitmask)  
Call this function to specify a recording source. Returns a bitmask indicating the new recording source (or sources) if successful; raises OSError if an invalid source was specified. To set the current recording source to the microphone input: mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)
oss_mixer_device.stereocontrols()  
Returns a bitmask indicating stereo mixer controls. If a bit is set, the corresponding control is stereo; if it is unset, the control is either monophonic or not supported by the mixer (use in combination with controls() to determine which). See the code example for the controls() function for an example of getting data from a bitmask.
exception OverflowError  
Raised when the result of an arithmetic operation is too large to be represented. This cannot occur for integers (which would rather raise MemoryError than give up). However, for historical reasons, OverflowError is sometimes raised for integers that are outside a required range. Because of the lack of standardization of floating point exception handling in C, most floating point operations are not checked.
parser.compilest(st, filename='<syntax-tree>')  
The Python byte compiler can be invoked on an ST object to produce code objects which can be used as part of a call to the built-in exec() or eval() functions. This function provides the interface to the compiler, passing the internal parse tree from st to the parser, using the source file name specified by the filename parameter. The default value supplied for filename indicates that the source was an ST object. Compiling an ST object may result in exceptions related to compilation; an example would be a SyntaxError caused by the parse tree for del f(0): this statement is considered legal within the formal grammar for Python but is not a legal language construct. The SyntaxError raised for this condition is actually generated by the Python byte-compiler normally, which is why it can be raised at this point by the parser module. Most causes of compilation failure can be diagnosed programmatically by inspection of the parse tree.
parser.expr(source)  
The expr() function parses the parameter source as if it were an input to compile(source, 'file.py', 'eval'). If the parse succeeds, an ST object is created to hold the internal parse tree representation, otherwise an appropriate exception is raised.
parser.isexpr(st)  
When st represents an 'eval' form, this function returns True, otherwise it returns False. This is useful, since code objects normally cannot be queried for this information using existing built-in functions. Note that the code objects created by compilest() cannot be queried like this either, and are identical to those created by the built-in compile() function.
parser.issuite(st)  
This function mirrors isexpr() in that it reports whether an ST object represents an 'exec' form, commonly known as a “suite.” It is not safe to assume that this function is equivalent to not isexpr(st), as additional syntactic fragments may be supported in the future.
exception parser.ParserError  
Exception raised when a failure occurs within the parser module. This is generally produced for validation failures rather than the built-in SyntaxError raised during normal parsing. The exception argument is either a string describing the reason of the failure or a tuple containing a sequence causing the failure from a parse tree passed to sequence2st() and an explanatory string. Calls to sequence2st() need to be able to handle either type of exception, while calls to other functions in the module will only need to be aware of the simple string values.
parser.sequence2st(sequence)  
This function accepts a parse tree represented as a sequence and builds an internal representation if possible. If it can validate that the tree conforms to the Python grammar and all nodes are valid node types in the host version of Python, an ST object is created from the internal representation and returned to the called. If there is a problem creating the internal representation, or if the tree cannot be validated, a ParserError exception is raised. An ST object created this way should not be assumed to compile correctly; normal exceptions raised by compilation may still be initiated when the ST object is passed to compilest(). This may indicate problems not related to syntax (such as a MemoryError exception), but may also be due to constructs such as the result of parsing del f(0), which escapes the Python parser but is checked by the bytecode compiler. Sequences representing terminal tokens may be represented as either two-element lists of the form (1, 'name') or as three-element lists of the form (1,
'name', 56). If the third element is present, it is assumed to be a valid line number. The line number may be specified for any subset of the terminal symbols in the input tree.
ST.compile(filename='<syntax-tree>')  
Same as compilest(st, filename).
ST.tolist(line_info=False, col_info=False)  
Same as st2list(st, line_info, col_info).
ST.totuple(line_info=False, col_info=False)  
Same as st2tuple(st, line_info, col_info).
parser.st2list(st, line_info=False, col_info=False)  
This function accepts an ST object from the caller in st and returns a Python list representing the equivalent parse tree. The resulting list representation can be used for inspection or the creation of a new parse tree in list form. This function does not fail so long as memory is available to build the list representation. If the parse tree will only be used for inspection, st2tuple() should be used instead to reduce memory consumption and fragmentation. When the list representation is required, this function is significantly faster than retrieving a tuple representation and converting that to nested lists. If line_info is true, line number information will be included for all terminal tokens as a third element of the list representing the token. Note that the line number provided specifies the line on which the token ends. This information is omitted if the flag is false or omitted.
parser.st2tuple(st, line_info=False, col_info=False)  
This function accepts an ST object from the caller in st and returns a Python tuple representing the equivalent parse tree. Other than returning a tuple instead of a list, this function is identical to st2list(). If line_info is true, line number information will be included for all terminal tokens as a third element of the list representing the token. This information is omitted if the flag is false or omitted.
parser.STType  
The type of the objects returned by expr(), suite() and sequence2st().
parser.suite(source)  
The suite() function parses the parameter source as if it were an input to compile(source, 'file.py', 'exec'). If the parse succeeds, an ST object is created to hold the internal parse tree representation, otherwise an appropriate exception is raised.
parser.tuple2st(sequence)  
This is the same function as sequence2st(). This entry point is maintained for backward compatibility.
class pathlib.Path(*pathsegments)  
A subclass of PurePath, this class represents concrete paths of the system’s path flavour (instantiating it creates either a PosixPath or a WindowsPath): >>> Path('setup.py')
PosixPath('setup.py')
 pathsegments is specified similarly to PurePath.
Path.chmod(mode)  
Change the file mode and permissions, like os.chmod(): >>> p = Path('setup.py')
>>> p.stat().st_mode
33277
>>> p.chmod(0o444)
>>> p.stat().st_mode
33060
classmethod Path.cwd()  
Return a new path object representing the current directory (as returned by os.getcwd()): >>> Path.cwd()
PosixPath('/home/antoine/pathlib')
Path.exists()  
Whether the path points to an existing file or directory: >>> Path('.').exists()
True
>>> Path('setup.py').exists()
True
>>> Path('/etc').exists()
True
>>> Path('nonexistentfile').exists()
False
  Note If the path points to a symlink, exists() returns whether the symlink points to an existing file or directory.
Path.expanduser()  
Return a new path with expanded ~ and ~user constructs, as returned by os.path.expanduser(): >>> p = PosixPath('~/films/Monty Python')
>>> p.expanduser()
PosixPath('/home/eric/films/Monty Python')
  New in version 3.5.
Path.glob(pattern)  
Glob the given relative pattern in the directory represented by this path, yielding all matching files (of any kind): >>> sorted(Path('.').glob('*.py'))
[PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')]
>>> sorted(Path('.').glob('*/*.py'))
[PosixPath('docs/conf.py')]
 The “**” pattern means “this directory and all subdirectories, recursively”. In other words, it enables recursive globbing: >>> sorted(Path('.').glob('**/*.py'))
[PosixPath('build/lib/pathlib.py'),
 PosixPath('docs/conf.py'),
 PosixPath('pathlib.py'),
 PosixPath('setup.py'),
 PosixPath('test_pathlib.py')]
  Note Using the “**” pattern in large directory trees may consume an inordinate amount of time.  Raises an auditing event pathlib.Path.glob with arguments self, pattern.
Path.group()  
Return the name of the group owning the file. KeyError is raised if the file’s gid isn’t found in the system database.
classmethod Path.home()  
Return a new path object representing the user’s home directory (as returned by os.path.expanduser() with ~ construct): >>> Path.home()
PosixPath('/home/antoine')
  New in version 3.5.
Path.is_block_device()  
Return True if the path points to a block device (or a symbolic link pointing to a block device), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.
Path.is_char_device()  
Return True if the path points to a character device (or a symbolic link pointing to a character device), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.
Path.is_dir()  
Return True if the path points to a directory (or a symbolic link pointing to a directory), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.
Path.is_fifo()  
Return True if the path points to a FIFO (or a symbolic link pointing to a FIFO), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.
Path.is_file()  
Return True if the path points to a regular file (or a symbolic link pointing to a regular file), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.
Path.is_mount()  
Return True if the 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. Not implemented on Windows.  New in version 3.7.
Path.is_socket()  
Return True if the path points to a Unix socket (or a symbolic link pointing to a Unix socket), False if it points to another kind of file. False is also returned if the path doesn’t exist or is a broken symlink; other errors (such as permission errors) are propagated.