neulab/docprompting-conala huggingface dataset:
Dialect.lineterminator  
The string used to terminate lines produced by the writer. It defaults to '\r\n'.  Note The reader is hard-coded to recognise either '\r' or '\n' as end-of-line, and ignores lineterminator. This behavior may change in the future.
Dialect.quotechar  
A one-character string used to quote fields containing special characters, such as the delimiter or quotechar, or which contain new-line characters. It defaults to '"'.
Dialect.quoting  
Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the QUOTE_* constants (see section Module Contents) and defaults to QUOTE_MINIMAL.
Dialect.skipinitialspace  
When True, whitespace immediately following the delimiter is ignored. The default is False.
Dialect.strict  
When True, raise exception Error on bad CSV input. The default is False.
class csv.DictReader(f, fieldnames=None, restkey=None, restval=None, dialect='excel', *args, **kwds)  
Create an object that operates like a regular reader but maps the information in each row to a dict whose keys are given by the optional fieldnames parameter. The fieldnames parameter is a sequence. If fieldnames is omitted, the values in the first row of file f will be used as the fieldnames. Regardless of how the fieldnames are determined, the dictionary preserves their original ordering. If a row has more fields than fieldnames, the remaining data is put in a list and stored with the fieldname specified by restkey (which defaults to None). If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with the value of restval (which defaults to None). All other optional or keyword arguments are passed to the underlying reader instance.  Changed in version 3.6: Returned rows are now of type OrderedDict.   Changed in version 3.8: Returned rows are now of type dict.  A short usage example: >>> import csv
>>> with open('names.csv', newline='') as csvfile:
...     reader = csv.DictReader(csvfile)
...     for row in reader:
...         print(row['first_name'], row['last_name'])
...
Eric Idle
John Cleese

>>> print(row)
{'first_name': 'John', 'last_name': 'Cleese'}
class csv.DictWriter(f, fieldnames, restval='', extrasaction='raise', dialect='excel', *args, **kwds)  
Create an object which operates like a regular writer but maps dictionaries onto output rows. The fieldnames parameter is a sequence of keys that identify the order in which values in the dictionary passed to the writerow() method are written to file f. The optional restval parameter specifies the value to be written if the dictionary is missing a key in fieldnames. If the dictionary passed to the writerow() method contains a key not found in fieldnames, the optional extrasaction parameter indicates what action to take. If it is set to 'raise', the default value, a ValueError is raised. If it is set to 'ignore', extra values in the dictionary are ignored. Any other optional or keyword arguments are passed to the underlying writer instance. Note that unlike the DictReader class, the fieldnames parameter of the DictWriter class is not optional. A short usage example: import csv

with open('names.csv', 'w', newline='') as csvfile:
    fieldnames = ['first_name', 'last_name']
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)

    writer.writeheader()
    writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})
    writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
    writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
DictWriter.writeheader()  
Write a row with the field names (as specified in the constructor) to the writer’s file object, formatted according to the current dialect. Return the return value of the csvwriter.writerow() call used internally.  New in version 3.2.   Changed in version 3.8: writeheader() now also returns the value returned by the csvwriter.writerow() method it uses internally.
class csv.excel  
The excel class defines the usual properties of an Excel-generated CSV file. It is registered with the dialect name 'excel'.
class csv.excel_tab  
The excel_tab class defines the usual properties of an Excel-generated TAB-delimited file. It is registered with the dialect name 'excel-tab'.
csv.field_size_limit([new_limit])  
Returns the current maximum field size allowed by the parser. If new_limit is given, this becomes the new limit.
csv.get_dialect(name)  
Return the dialect associated with name. An Error is raised if name is not a registered dialect name. This function returns an immutable Dialect.
csv.QUOTE_MINIMAL  
Instructs writer objects to only quote those fields which contain special characters such as delimiter, quotechar or any of the characters in lineterminator.
csv.QUOTE_NONE  
Instructs writer objects to never quote fields. When the current delimiter occurs in output data it is preceded by the current escapechar character. If escapechar is not set, the writer will raise Error if any characters that require escaping are encountered. Instructs reader to perform no special processing of quote characters.
csv.QUOTE_NONNUMERIC  
Instructs writer objects to quote all non-numeric fields. Instructs the reader to convert all non-quoted fields to type float.
csv.reader(csvfile, dialect='excel', **fmtparams)  
Return a reader object which will iterate over lines in the given csvfile. csvfile can be any object which supports the iterator protocol and returns a string each time its __next__() method is called — file objects and list objects are both suitable. If csvfile is a file object, it should be opened with newline=''. 1 An optional dialect parameter can be given which is used to define a set of parameters specific to a particular CSV dialect. It may be an instance of a subclass of the Dialect class or one of the strings returned by the list_dialects() function. The other optional fmtparams keyword arguments can be given to override individual formatting parameters in the current dialect. For full details about the dialect and formatting parameters, see section Dialects and Formatting Parameters. Each row read from the csv file is returned as a list of strings. No automatic data type conversion is performed unless the QUOTE_NONNUMERIC format option is specified (in which case unquoted fields are transformed into floats). A short usage example: >>> import csv
>>> with open('eggs.csv', newline='') as csvfile:
...     spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
...     for row in spamreader:
...         print(', '.join(row))
Spam, Spam, Spam, Spam, Spam, Baked Beans
Spam, Lovely Spam, Wonderful Spam
csv.register_dialect(name[, dialect[, **fmtparams]])  
Associate dialect with name. name must be a string. The dialect can be specified either by passing a sub-class of Dialect, or by fmtparams keyword arguments, or both, with keyword arguments overriding parameters of the dialect. For full details about the dialect and formatting parameters, see section Dialects and Formatting Parameters.
class csv.Sniffer  
The Sniffer class is used to deduce the format of a CSV file. The Sniffer class provides two methods:  
sniff(sample, delimiters=None)  
Analyze the given sample and return a Dialect subclass reflecting the parameters found. If the optional delimiters parameter is given, it is interpreted as a string containing possible valid delimiter characters. 
  
has_header(sample)  
Analyze the sample text (presumed to be in CSV format) and return True if the first row appears to be a series of column headers.
has_header(sample)  
Analyze the sample text (presumed to be in CSV format) and return True if the first row appears to be a series of column headers.
sniff(sample, delimiters=None)  
Analyze the given sample and return a Dialect subclass reflecting the parameters found. If the optional delimiters parameter is given, it is interpreted as a string containing possible valid delimiter characters.
class csv.unix_dialect  
The unix_dialect class defines the usual properties of a CSV file generated on UNIX systems, i.e. using '\n' as line terminator and quoting all fields. It is registered with the dialect name 'unix'.  New in version 3.2.
csv.unregister_dialect(name)  
Delete the dialect associated with name from the dialect registry. An Error is raised if name is not a registered dialect name.
csv.writer(csvfile, dialect='excel', **fmtparams)  
Return a writer object responsible for converting the user’s data into delimited strings on the given file-like object. csvfile can be any object with a write() method. If csvfile is a file object, it should be opened with newline='' 1. An optional dialect parameter can be given which is used to define a set of parameters specific to a particular CSV dialect. It may be an instance of a subclass of the Dialect class or one of the strings returned by the list_dialects() function. The other optional fmtparams keyword arguments can be given to override individual formatting parameters in the current dialect. For full details about the dialect and formatting parameters, see section Dialects and Formatting Parameters. To make it as easy as possible to interface with modules which implement the DB API, the value None is written as the empty string. While this isn’t a reversible transformation, it makes it easier to dump SQL NULL data values to CSV files without preprocessing the data returned from a cursor.fetch* call. All other non-string data are stringified with str() before being written. A short usage example: import csv
with open('eggs.csv', 'w', newline='') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ',
                            quotechar='|', quoting=csv.QUOTE_MINIMAL)
    spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
    spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
ctypes.addressof(obj)  
Returns the address of the memory buffer as integer. obj must be an instance of a ctypes type. Raises an auditing event ctypes.addressof with argument obj.
ctypes.alignment(obj_or_type)  
Returns the alignment requirements of a ctypes type. obj_or_type must be a ctypes type or instance.
exception ctypes.ArgumentError  
This exception is raised when a foreign function call cannot convert one of the passed arguments.
class ctypes.Array(*args)  
Abstract base class for arrays. The recommended way to create concrete array types is by multiplying any ctypes data type with a positive integer. Alternatively, you can subclass this type and define _length_ and _type_ class variables. Array elements can be read and written using standard subscript and slice accesses; for slice reads, the resulting object is not itself an Array.  
_length_  
A positive integer specifying the number of elements in the array. Out-of-range subscripts result in an IndexError. Will be returned by len(). 
  
_type_  
Specifies the type of each element in the array. 
 Array subclass constructors accept positional arguments, used to initialize the elements in order.
_length_  
A positive integer specifying the number of elements in the array. Out-of-range subscripts result in an IndexError. Will be returned by len().
class ctypes.BigEndianStructure(*args, **kw)  
Abstract base class for structures in big endian byte order.
ctypes.byref(obj[, offset])  
Returns a light-weight pointer to obj, which must be an instance of a ctypes type. offset defaults to zero, and must be an integer that will be added to the internal pointer value. byref(obj, offset) corresponds to this C code: (((char *)&obj) + offset)
 The returned object can only be used as a foreign function call parameter. It behaves similar to pointer(obj), but the construction is a lot faster.
ctypes.cast(obj, type)  
This function is similar to the cast operator in C. It returns a new instance of type which points to the same memory block as obj. type must be a pointer type, and obj must be an object that can be interpreted as a pointer.
class ctypes.CDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)  
Instances of this class represent loaded shared libraries. Functions in these libraries use the standard C calling convention, and are assumed to return int. On Windows creating a CDLL instance may fail even if the DLL name exists. When a dependent DLL of the loaded DLL is not found, a OSError error is raised with the message “[WinError 126] The specified module could not be found”. This error message does not contain the name of the missing DLL because the Windows API does not return this information making this error hard to diagnose. To resolve this error and determine which DLL is not found, you need to find the list of dependent DLLs and determine which one is not found using Windows debugging and tracing tools.
ctypes.CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)  
The returned function prototype creates functions that use the standard C calling convention. The function will release the GIL during the call. If use_errno is set to true, the ctypes private copy of the system errno variable is exchanged with the real errno value before and after the call; use_last_error does the same for the Windows error code.
ctypes.create_string_buffer(init_or_size, size=None)  
This function creates a mutable character buffer. The returned object is a ctypes array of c_char. init_or_size must be an integer which specifies the size of the array, or a bytes object which will be used to initialize the array items. If a bytes object is specified as first argument, the buffer is made one item larger than its length so that the last element in the array is a NUL termination character. An integer can be passed as second argument which allows specifying the size of the array if the length of the bytes should not be used. Raises an auditing event ctypes.create_string_buffer with arguments init, size.
ctypes.create_unicode_buffer(init_or_size, size=None)  
This function creates a mutable unicode character buffer. The returned object is a ctypes array of c_wchar. init_or_size must be an integer which specifies the size of the array, or a string which will be used to initialize the array items. If a string is specified as first argument, the buffer is made one item larger than the length of the string so that the last element in the array is a NUL termination character. An integer can be passed as second argument which allows specifying the size of the array if the length of the string should not be used. Raises an auditing event ctypes.create_unicode_buffer with arguments init, size.
class ctypes.c_bool  
Represent the C bool datatype (more accurately, _Bool from C99). Its value can be True or False, and the constructor accepts any object that has a truth value.
class ctypes.c_byte  
Represents the C signed char datatype, and interprets the value as small integer. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_char  
Represents the C char datatype, and interprets the value as a single character. The constructor accepts an optional string initializer, the length of the string must be exactly one character.
class ctypes.c_char_p  
Represents the C char * datatype when it points to a zero-terminated string. For a general character pointer that may also point to binary data, POINTER(c_char) must be used. The constructor accepts an integer address, or a bytes object.
class ctypes.c_double  
Represents the C double datatype. The constructor accepts an optional float initializer.
class ctypes.c_float  
Represents the C float datatype. The constructor accepts an optional float initializer.
class ctypes.c_int  
Represents the C signed int datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where sizeof(int) == sizeof(long) it is an alias to c_long.
class ctypes.c_int16  
Represents the C 16-bit signed int datatype. Usually an alias for c_short.
class ctypes.c_int32  
Represents the C 32-bit signed int datatype. Usually an alias for c_int.
class ctypes.c_int64  
Represents the C 64-bit signed int datatype. Usually an alias for c_longlong.
class ctypes.c_int8  
Represents the C 8-bit signed int datatype. Usually an alias for c_byte.
class ctypes.c_long  
Represents the C signed long datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_longdouble  
Represents the C long double datatype. The constructor accepts an optional float initializer. On platforms where sizeof(long double) ==
sizeof(double) it is an alias to c_double.
class ctypes.c_longlong  
Represents the C signed long long datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_short  
Represents the C signed short datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_size_t  
Represents the C size_t datatype.
class ctypes.c_ssize_t  
Represents the C ssize_t datatype.  New in version 3.2.
class ctypes.c_ubyte  
Represents the C unsigned char datatype, it interprets the value as small integer. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_uint  
Represents the C unsigned int datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where sizeof(int) == sizeof(long) it is an alias for c_ulong.
class ctypes.c_uint16  
Represents the C 16-bit unsigned int datatype. Usually an alias for c_ushort.
class ctypes.c_uint32  
Represents the C 32-bit unsigned int datatype. Usually an alias for c_uint.
class ctypes.c_uint64  
Represents the C 64-bit unsigned int datatype. Usually an alias for c_ulonglong.
class ctypes.c_uint8  
Represents the C 8-bit unsigned int datatype. Usually an alias for c_ubyte.
class ctypes.c_ulong  
Represents the C unsigned long datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_ulonglong  
Represents the C unsigned long long datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_ushort  
Represents the C unsigned short datatype. The constructor accepts an optional integer initializer; no overflow checking is done.
class ctypes.c_void_p  
Represents the C void * type. The value is represented as integer. The constructor accepts an optional integer initializer.
class ctypes.c_wchar  
Represents the C wchar_t datatype, and interprets the value as a single character unicode string. The constructor accepts an optional string initializer, the length of the string must be exactly one character.
class ctypes.c_wchar_p  
Represents the C wchar_t * datatype, which must be a pointer to a zero-terminated wide character string. The constructor accepts an integer address, or a string.
ctypes.DllCanUnloadNow()  
Windows only: This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllCanUnloadNow function that the _ctypes extension dll exports.
ctypes.DllGetClassObject()  
Windows only: This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllGetClassObject function that the _ctypes extension dll exports.
ctypes.FormatError([code])  
Windows only: Returns a textual description of the error code code. If no error code is specified, the last error code is used by calling the Windows api function GetLastError.
ctypes.GetLastError()  
Windows only: Returns the last error code set by Windows in the calling thread. This function calls the Windows GetLastError() function directly, it does not return the ctypes-private copy of the error code.
ctypes.get_errno()  
Returns the current value of the ctypes-private copy of the system errno variable in the calling thread. Raises an auditing event ctypes.get_errno with no arguments.
ctypes.get_last_error()  
Windows only: returns the current value of the ctypes-private copy of the system LastError variable in the calling thread. Raises an auditing event ctypes.get_last_error with no arguments.
class ctypes.HRESULT  
Windows only: Represents a HRESULT value, which contains success or error information for a function or method call.
class ctypes.LibraryLoader(dlltype)  
Class which loads shared libraries. dlltype should be one of the CDLL, PyDLL, WinDLL, or OleDLL types. __getattr__() has special behavior: It allows loading a shared library by accessing it as attribute of a library loader instance. The result is cached, so repeated attribute accesses return the same library each time.  
LoadLibrary(name)  
Load a shared library into the process and return it. This method always returns a new instance of the library.
LoadLibrary(name)  
Load a shared library into the process and return it. This method always returns a new instance of the library.
class ctypes.LittleEndianStructure(*args, **kw)  
Abstract base class for structures in little endian byte order.
ctypes.memmove(dst, src, count)  
Same as the standard C memmove library function: copies count bytes from src to dst. dst and src must be integers or ctypes instances that can be converted to pointers.
ctypes.memset(dst, c, count)  
Same as the standard C memset library function: fills the memory block at address dst with count bytes of value c. dst must be an integer specifying an address, or a ctypes instance.
class ctypes.OleDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)  
Windows only: Instances of this class represent loaded shared libraries, functions in these libraries use the stdcall calling convention, and are assumed to return the windows specific HRESULT code. HRESULT values contain information specifying whether the function call failed or succeeded, together with additional error code. If the return value signals a failure, an OSError is automatically raised.  Changed in version 3.3: WindowsError used to be raised.
ctypes.POINTER(type)  
This factory function creates and returns a new ctypes pointer type. Pointer types are cached and reused internally, so calling this function repeatedly is cheap. type must be a ctypes type.
ctypes.pointer(obj)  
This function creates a new pointer instance, pointing to obj. The returned object is of the type POINTER(type(obj)). Note: If you just want to pass a pointer to an object to a foreign function call, you should use byref(obj) which is much faster.
class ctypes.PyDLL(name, mode=DEFAULT_MODE, handle=None)  
Instances of this class behave like CDLL instances, except that the Python GIL is not released during the function call, and after the function execution the Python error flag is checked. If the error flag is set, a Python exception is raised. Thus, this is only useful to call Python C api functions directly.
ctypes.PYFUNCTYPE(restype, *argtypes)  
The returned function prototype creates functions that use the Python calling convention. The function will not release the GIL during the call.
class ctypes.py_object  
Represents the C PyObject * datatype. Calling this without an argument creates a NULL PyObject * pointer.
ctypes.resize(obj, size)  
This function resizes the internal memory buffer of obj, which must be an instance of a ctypes type. It is not possible to make the buffer smaller than the native size of the objects type, as given by sizeof(type(obj)), but it is possible to enlarge the buffer.
ctypes.set_errno(value)  
Set the current value of the ctypes-private copy of the system errno variable in the calling thread to value and return the previous value. Raises an auditing event ctypes.set_errno with argument errno.
ctypes.set_last_error(value)  
Windows only: set the current value of the ctypes-private copy of the system LastError variable in the calling thread to value and return the previous value. Raises an auditing event ctypes.set_last_error with argument error.
ctypes.sizeof(obj_or_type)  
Returns the size in bytes of a ctypes type or instance memory buffer. Does the same as the C sizeof operator.
ctypes.string_at(address, size=-1)  
This function returns the C string starting at memory address address as a bytes object. If size is specified, it is used as size, otherwise the string is assumed to be zero-terminated. Raises an auditing event ctypes.string_at with arguments address, size.