neulab/docprompting-conala huggingface dataset:
class calendar.HTMLCalendar(firstweekday=0)  
This class can be used to generate HTML calendars. HTMLCalendar instances have the following methods:  
formatmonth(theyear, themonth, withyear=True)  
Return a month’s calendar as an HTML table. If withyear is true the year will be included in the header, otherwise just the month name will be used. 
  
formatyear(theyear, width=3)  
Return a year’s calendar as an HTML table. width (defaulting to 3) specifies the number of months per row. 
  
formatyearpage(theyear, width=3, css='calendar.css', encoding=None)  
Return a year’s calendar as a complete HTML page. width (defaulting to 3) specifies the number of months per row. css is the name for the cascading style sheet to be used. None can be passed if no style sheet should be used. encoding specifies the encoding to be used for the output (defaulting to the system default encoding). 
 HTMLCalendar has the following attributes you can override to customize the CSS classes used by the calendar:  
cssclasses  
A list of CSS classes used for each weekday. The default class list is: cssclasses = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
 more styles can be added for each day: cssclasses = ["mon text-bold", "tue", "wed", "thu", "fri", "sat", "sun red"]
 Note that the length of this list must be seven items. 
  
cssclass_noday  
The CSS class for a weekday occurring in the previous or coming month.  New in version 3.7.  
  
cssclasses_weekday_head  
A list of CSS classes used for weekday names in the header row. The default is the same as cssclasses.  New in version 3.7.  
  
cssclass_month_head  
The month’s head CSS class (used by formatmonthname()). The default value is "month".  New in version 3.7.  
  
cssclass_month  
The CSS class for the whole month’s table (used by formatmonth()). The default value is "month".  New in version 3.7.  
  
cssclass_year  
The CSS class for the whole year’s table of tables (used by formatyear()). The default value is "year".  New in version 3.7.  
  
cssclass_year_head  
The CSS class for the table head for the whole year (used by formatyear()). The default value is "year".  New in version 3.7.  
 Note that although the naming for the above described class attributes is singular (e.g. cssclass_month cssclass_noday), one can replace the single CSS class with a space separated list of CSS classes, for example: "text-bold text-red"
 Here is an example how HTMLCalendar can be customized: class CustomHTMLCal(calendar.HTMLCalendar):
    cssclasses = [style + " text-nowrap" for style in
                  calendar.HTMLCalendar.cssclasses]
    cssclass_month_head = "text-center month-head"
    cssclass_month = "text-center month"
    cssclass_year = "text-italic lead"
cssclasses  
A list of CSS classes used for each weekday. The default class list is: cssclasses = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
 more styles can be added for each day: cssclasses = ["mon text-bold", "tue", "wed", "thu", "fri", "sat", "sun red"]
 Note that the length of this list must be seven items.
cssclasses_weekday_head  
A list of CSS classes used for weekday names in the header row. The default is the same as cssclasses.  New in version 3.7.
cssclass_month  
The CSS class for the whole month’s table (used by formatmonth()). The default value is "month".  New in version 3.7.
cssclass_month_head  
The month’s head CSS class (used by formatmonthname()). The default value is "month".  New in version 3.7.
cssclass_noday  
The CSS class for a weekday occurring in the previous or coming month.  New in version 3.7.
cssclass_year  
The CSS class for the whole year’s table of tables (used by formatyear()). The default value is "year".  New in version 3.7.
cssclass_year_head  
The CSS class for the table head for the whole year (used by formatyear()). The default value is "year".  New in version 3.7.
formatmonth(theyear, themonth, withyear=True)  
Return a month’s calendar as an HTML table. If withyear is true the year will be included in the header, otherwise just the month name will be used.
formatyear(theyear, width=3)  
Return a year’s calendar as an HTML table. width (defaulting to 3) specifies the number of months per row.
formatyearpage(theyear, width=3, css='calendar.css', encoding=None)  
Return a year’s calendar as a complete HTML page. width (defaulting to 3) specifies the number of months per row. css is the name for the cascading style sheet to be used. None can be passed if no style sheet should be used. encoding specifies the encoding to be used for the output (defaulting to the system default encoding).
calendar.isleap(year)  
Returns True if year is a leap year, otherwise False.
calendar.leapdays(y1, y2)  
Returns the number of leap years in the range from y1 to y2 (exclusive), where y1 and y2 are years. This function works for ranges spanning a century change.
class calendar.LocaleHTMLCalendar(firstweekday=0, locale=None)  
This subclass of HTMLCalendar can be passed a locale name in the constructor and will return month and weekday names in the specified locale. If this locale includes an encoding all strings containing month and weekday names will be returned as unicode.
class calendar.LocaleTextCalendar(firstweekday=0, locale=None)  
This subclass of TextCalendar can be passed a locale name in the constructor and will return month and weekday names in the specified locale. If this locale includes an encoding all strings containing month and weekday names will be returned as unicode.
calendar.month(theyear, themonth, w=0, l=0)  
Returns a month’s calendar in a multi-line string using the formatmonth() of the TextCalendar class.
calendar.monthcalendar(year, month)  
Returns a matrix representing a month’s calendar. Each row represents a week; days outside of the month are represented by zeros. Each week begins with Monday unless set by setfirstweekday().
calendar.monthrange(year, month)  
Returns weekday of first day of the month and number of days in month, for the specified year and month.
calendar.month_abbr  
An array that represents the abbreviated months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and month_abbr[0] is the empty string.
calendar.month_name  
An array that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and month_name[0] is the empty string.
calendar.prcal(year, w=0, l=0, c=6, m=3)  
Prints the calendar for an entire year as returned by calendar().
calendar.prmonth(theyear, themonth, w=0, l=0)  
Prints a month’s calendar as returned by month().
calendar.setfirstweekday(weekday)  
Sets the weekday (0 is Monday, 6 is Sunday) to start each week. The values MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY are provided for convenience. For example, to set the first weekday to Sunday: import calendar
calendar.setfirstweekday(calendar.SUNDAY)
class calendar.TextCalendar(firstweekday=0)  
This class can be used to generate plain text calendars. TextCalendar instances have the following methods:  
formatmonth(theyear, themonth, w=0, l=0)  
Return a month’s calendar in a multi-line string. If w is provided, it specifies the width of the date columns, which are centered. If l is given, it specifies the number of lines that each week will use. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method. 
  
prmonth(theyear, themonth, w=0, l=0)  
Print a month’s calendar as returned by formatmonth(). 
  
formatyear(theyear, w=2, l=1, c=6, m=3)  
Return a m-column calendar for an entire year as a multi-line string. Optional parameters w, l, and c are for date column width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method. The earliest year for which a calendar can be generated is platform-dependent. 
  
pryear(theyear, w=2, l=1, c=6, m=3)  
Print the calendar for an entire year as returned by formatyear().
formatmonth(theyear, themonth, w=0, l=0)  
Return a month’s calendar in a multi-line string. If w is provided, it specifies the width of the date columns, which are centered. If l is given, it specifies the number of lines that each week will use. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method.
formatyear(theyear, w=2, l=1, c=6, m=3)  
Return a m-column calendar for an entire year as a multi-line string. Optional parameters w, l, and c are for date column width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method. The earliest year for which a calendar can be generated is platform-dependent.
prmonth(theyear, themonth, w=0, l=0)  
Print a month’s calendar as returned by formatmonth().
pryear(theyear, w=2, l=1, c=6, m=3)  
Print the calendar for an entire year as returned by formatyear().
calendar.timegm(tuple)  
An unrelated but handy function that takes a time tuple such as returned by the gmtime() function in the time module, and returns the corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In fact, time.gmtime() and timegm() are each others’ inverse.
calendar.weekday(year, month, day)  
Returns the day of the week (0 is Monday) for year (1970–…), month (1–12), day (1–31).
calendar.weekheader(n)  
Return a header containing abbreviated weekday names. n specifies the width in characters for one weekday.
callable(object)  
Return True if the object argument appears callable, False if not. If this returns True, it is still possible that a call fails, but if it is False, calling object will never succeed. Note that classes are callable (calling a class returns a new instance); instances are callable if their class has a __call__() method.  New in version 3.2: This function was first removed in Python 3.0 and then brought back in Python 3.2.
FieldStorage.getfirst(name, default=None)  
This method always returns only one value associated with form field name. The method returns only the first value in case that more values were posted under such name. Please note that the order in which the values are received may vary from browser to browser and should not be counted on. 1 If no such form field or value exists then the method returns the value specified by the optional parameter default. This parameter defaults to None if not specified.
FieldStorage.getlist(name)  
This method always returns a list of values associated with form field name. The method returns an empty list if no such form field or value exists for name. It returns a list consisting of one item if only one such value exists.
cgi.parse(fp=None, environ=os.environ, keep_blank_values=False, strict_parsing=False, separator="&")  
Parse a query in the environment or from a file (the file defaults to sys.stdin). The keep_blank_values, strict_parsing and separator parameters are passed to urllib.parse.parse_qs() unchanged.
cgi.parse_header(string)  
Parse a MIME header (such as Content-Type) into a main value and a dictionary of parameters.
cgi.parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator="&")  
Parse input of type multipart/form-data (for file uploads). Arguments are fp for the input file, pdict for a dictionary containing other parameters in the Content-Type header, and encoding, the request encoding. Returns a dictionary just like urllib.parse.parse_qs(): keys are the field names, each value is a list of values for that field. For non-file fields, the value is a list of strings. This is easy to use but not much good if you are expecting megabytes to be uploaded — in that case, use the FieldStorage class instead which is much more flexible.  Changed in version 3.7: Added the encoding and errors parameters. For non-file fields, the value is now a list of strings, not bytes.   Changed in version 3.9.2: Added the separator parameter.
cgi.print_environ_usage()  
Print a list of useful (used by CGI) environment variables in HTML.
cgi.test()  
Robust test CGI script, usable as main program. Writes minimal HTTP headers and formats all information provided to the script in HTML form.
cgitb — Traceback manager for CGI scripts Source code: Lib/cgitb.py The cgitb module provides a special exception handler for Python scripts. (Its name is a bit misleading. It was originally designed to display extensive traceback information in HTML for CGI scripts. It was later generalized to also display this information in plain text.) After this module is activated, if an uncaught exception occurs, a detailed, formatted report will be displayed. The report includes a traceback showing excerpts of the source code for each level, as well as the values of the arguments and local variables to currently running functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. To enable this feature, simply add this to the top of your CGI script: import cgitb
cgitb.enable()
 The options to the enable() function control whether the report is displayed in the browser and whether the report is logged to a file for later analysis.  
cgitb.enable(display=1, logdir=None, context=5, format="html")  
This function causes the cgitb module to take over the interpreter’s default handling for exceptions by setting the value of sys.excepthook. The optional argument display defaults to 1 and can be set to 0 to suppress sending the traceback to the browser. If the argument logdir is present, the traceback reports are written to files. The value of logdir should be a directory where these files will be placed. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5. If the optional argument format is "html", the output is formatted as HTML. Any other value forces plain text output. The default value is "html". 
  
cgitb.text(info, context=5)  
This function handles the exception described by info (a 3-tuple containing the result of sys.exc_info()), formatting its traceback as text and returning the result as a string. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5. 
  
cgitb.html(info, context=5)  
This function handles the exception described by info (a 3-tuple containing the result of sys.exc_info()), formatting its traceback as HTML and returning the result as a string. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5. 
  
cgitb.handler(info=None)  
This function handles an exception using the default settings (that is, show a report in the browser, but don’t log to a file). This can be used when you’ve caught an exception and want to report it using cgitb. The optional info argument should be a 3-tuple containing an exception type, exception value, and traceback object, exactly like the tuple returned by sys.exc_info(). If the info argument is not supplied, the current exception is obtained from sys.exc_info().
cgitb.enable(display=1, logdir=None, context=5, format="html")  
This function causes the cgitb module to take over the interpreter’s default handling for exceptions by setting the value of sys.excepthook. The optional argument display defaults to 1 and can be set to 0 to suppress sending the traceback to the browser. If the argument logdir is present, the traceback reports are written to files. The value of logdir should be a directory where these files will be placed. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5. If the optional argument format is "html", the output is formatted as HTML. Any other value forces plain text output. The default value is "html".
cgitb.handler(info=None)  
This function handles an exception using the default settings (that is, show a report in the browser, but don’t log to a file). This can be used when you’ve caught an exception and want to report it using cgitb. The optional info argument should be a 3-tuple containing an exception type, exception value, and traceback object, exactly like the tuple returned by sys.exc_info(). If the info argument is not supplied, the current exception is obtained from sys.exc_info().
cgitb.html(info, context=5)  
This function handles the exception described by info (a 3-tuple containing the result of sys.exc_info()), formatting its traceback as HTML and returning the result as a string. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5.
cgitb.text(info, context=5)  
This function handles the exception described by info (a 3-tuple containing the result of sys.exc_info()), formatting its traceback as text and returning the result as a string. The optional argument context is the number of lines of context to display around the current line of source code in the traceback; this defaults to 5.
exception ChildProcessError  
Raised when an operation on a child process failed. Corresponds to errno ECHILD.
chr(i)  
Return the string representing a character whose Unicode code point is the integer i. For example, chr(97) returns the string 'a', while chr(8364) returns the string '€'. This is the inverse of ord(). The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16). ValueError will be raised if i is outside that range.
class chunk.Chunk(file, align=True, bigendian=True, inclheader=False)  
Class which represents a chunk. The file argument is expected to be a file-like object. An instance of this class is specifically allowed. The only method that is needed is read(). If the methods seek() and tell() are present and don’t raise an exception, they are also used. If these methods are present and raise an exception, they are expected to not have altered the object. If the optional argument align is true, chunks are assumed to be aligned on 2-byte boundaries. If align is false, no alignment is assumed. The default value is true. If the optional argument bigendian is false, the chunk size is assumed to be in little-endian order. This is needed for WAVE audio files. The default value is true. If the optional argument inclheader is true, the size given in the chunk header includes the size of the header. The default value is false. A Chunk object supports the following methods:  
getname()  
Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk. 
  
getsize()  
Returns the size of the chunk. 
  
close()  
Close and skip to the end of the chunk. This does not close the underlying file. 
 The remaining methods will raise OSError if called after the close() method has been called. Before Python 3.3, they used to raise IOError, now an alias of OSError.  
isatty()  
Returns False. 
  
seek(pos, whence=0)  
Set the chunk’s current position. The whence argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek relative to the current position) and 2 (seek relative to the file’s end). There is no return value. If the underlying file does not allow seek, only forward seeks are allowed. 
  
tell()  
Return the current position into the chunk. 
  
read(size=-1)  
Read at most size bytes from the chunk (less if the read hits the end of the chunk before obtaining size bytes). If the size argument is negative or omitted, read all data until the end of the chunk. An empty bytes object is returned when the end of the chunk is encountered immediately. 
  
skip()  
Skip to the end of the chunk. All further calls to read() for the chunk will return b''. If you are not interested in the contents of the chunk, this method should be called so that the file points to the start of the next chunk.
close()  
Close and skip to the end of the chunk. This does not close the underlying file.
getname()  
Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk.
read(size=-1)  
Read at most size bytes from the chunk (less if the read hits the end of the chunk before obtaining size bytes). If the size argument is negative or omitted, read all data until the end of the chunk. An empty bytes object is returned when the end of the chunk is encountered immediately.
seek(pos, whence=0)  
Set the chunk’s current position. The whence argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek relative to the current position) and 2 (seek relative to the file’s end). There is no return value. If the underlying file does not allow seek, only forward seeks are allowed.
skip()  
Skip to the end of the chunk. All further calls to read() for the chunk will return b''. If you are not interested in the contents of the chunk, this method should be called so that the file points to the start of the next chunk.
class.mro()  
This method can be overridden by a metaclass to customize the method resolution order for its instances. It is called at class instantiation, and its result is stored in __mro__.
class.__mro__  
This attribute is a tuple of classes that are considered when looking for base classes during method resolution.
class.__subclasses__()  
Each class keeps a list of weak references to its immediate subclasses. This method returns a list of all those references still alive. The list is in definition order. Example: >>> int.__subclasses__()
[<class 'bool'>]
@classmethod  
Transform a method into a class method. A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom: class C:
    @classmethod
    def f(cls, arg1, arg2, ...): ...
 The @classmethod form is a function decorator – see Function definitions for details. A class method can be called either on the class (such as C.f()) or on an instance (such as C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument. Class methods are different than C++ or Java static methods. If you want those, see staticmethod() in this section. For more information on class methods, see The standard type hierarchy.  Changed in version 3.9: Class methods can now wrap other descriptors such as property().
cmath.acos(x)  
Return the arc cosine of x. There are two branch cuts: One extends right from 1 along the real axis to ∞, continuous from below. The other extends left from -1 along the real axis to -∞, continuous from above.
cmath.acosh(x)  
Return the inverse hyperbolic cosine of x. There is one branch cut, extending left from 1 along the real axis to -∞, continuous from above.
cmath.asin(x)  
Return the arc sine of x. This has the same branch cuts as acos().
cmath.asinh(x)  
Return the inverse hyperbolic sine of x. There are two branch cuts: One extends from 1j along the imaginary axis to ∞j, continuous from the right. The other extends from -1j along the imaginary axis to -∞j, continuous from the left.
cmath.atan(x)  
Return the arc tangent of x. There are two branch cuts: One extends from 1j along the imaginary axis to ∞j, continuous from the right. The other extends from -1j along the imaginary axis to -∞j, continuous from the left.
cmath.atanh(x)  
Return the inverse hyperbolic tangent of x. There are two branch cuts: One extends from 1 along the real axis to ∞, continuous from below. The other extends from -1 along the real axis to -∞, continuous from above.
cmath.exp(x)  
Return e raised to the power x, where e is the base of natural logarithms.
cmath.inf  
Floating-point positive infinity. Equivalent to float('inf').  New in version 3.6.
cmath.infj  
Complex number with zero real part and positive infinity imaginary part. Equivalent to complex(0.0, float('inf')).  New in version 3.6.