neulab/docprompting-conala huggingface dataset:
time.strptime(string[, format])  
Parse a string representing a time according to a format. The return value is a struct_time as returned by gmtime() or localtime(). The format parameter uses the same directives as those used by strftime(); it defaults to "%a %b %d %H:%M:%S %Y" which matches the formatting returned by ctime(). If string cannot be parsed according to format, or if it has excess data after parsing, ValueError is raised. The default values used to fill in any missing data when more accurate values cannot be inferred are (1900, 1, 1, 0, 0, 0, 0, 1, -1). Both string and format must be strings. For example: >>> import time
>>> time.strptime("30 Nov 00", "%d %b %y")   
time.struct_time(tm_year=2000, tm_mon=11, tm_mday=30, tm_hour=0, tm_min=0,
                 tm_sec=0, tm_wday=3, tm_yday=335, tm_isdst=-1)
 Support for the %Z directive is based on the values contained in tzname and whether daylight is true. Because of this, it is platform-specific except for recognizing UTC and GMT which are always known (and are considered to be non-daylight savings timezones). Only the directives specified in the documentation are supported. Because strftime() is implemented per platform it can sometimes offer more directives than those listed. But strptime() is independent of any platform and thus does not necessarily support all directives available that are not documented as supported.
class time.struct_time  
The type of the time value sequence returned by gmtime(), localtime(), and strptime(). It is an object with a named tuple interface: values can be accessed by index and by attribute name. The following values are present:   
Index Attribute Values   
0 tm_year (for example, 1993)  
1 tm_mon range [1, 12]  
2 tm_mday range [1, 31]  
3 tm_hour range [0, 23]  
4 tm_min range [0, 59]  
5 tm_sec range [0, 61]; see (2) in strftime() description  
6 tm_wday range [0, 6], Monday is 0  
7 tm_yday range [1, 366]  
8 tm_isdst 0, 1 or -1; see below  
N/A tm_zone abbreviation of timezone name  
N/A tm_gmtoff offset east of UTC in seconds   Note that unlike the C structure, the month value is a range of [1, 12], not [0, 11]. In calls to mktime(), tm_isdst may be set to 1 when daylight savings time is in effect, and 0 when it is not. A value of -1 indicates that this is not known, and will usually result in the correct state being filled in. When a tuple with an incorrect length is passed to a function expecting a struct_time, or having elements of the wrong type, a TypeError is raised.
time.thread_time() → float  
Return the value (in fractional seconds) of the sum of the system and user CPU time of the current thread. It does not include time elapsed during sleep. It is thread-specific by definition. The reference point of the returned value is undefined, so that only the difference between the results of two calls in the same thread is valid. Availability: Windows, Linux, Unix systems supporting CLOCK_THREAD_CPUTIME_ID.  New in version 3.7.
time.thread_time_ns() → int  
Similar to thread_time() but return time as nanoseconds.  New in version 3.7.
time.time() → float  
Return the time in seconds since the epoch as a floating point number. The specific date of the epoch and the handling of leap seconds is platform dependent. On Windows and most Unix systems, the epoch is January 1, 1970, 00:00:00 (UTC) and leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as Unix time. To find out what the epoch is on a given platform, look at gmtime(0). Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls. The number returned by time() may be converted into a more common time format (i.e. year, month, day, hour, etc…) in UTC by passing it to gmtime() function or in local time by passing it to the localtime() function. In both cases a struct_time object is returned, from which the components of the calendar date may be accessed as attributes.
time.timezone  
The offset of the local (non-DST) timezone, in seconds west of UTC (negative in most of Western Europe, positive in the US, zero in the UK). See note below.
time.time_ns() → int  
Similar to time() but returns time as an integer number of nanoseconds since the epoch.  New in version 3.7.
time.tzname  
A tuple of two strings: the first is the name of the local non-DST timezone, the second is the name of the local DST timezone. If no DST timezone is defined, the second string should not be used. See note below.
time.tzset()  
Reset the time conversion rules used by the library routines. The environment variable TZ specifies how this is done. It will also set the variables tzname (from the TZ environment variable), timezone (non-DST seconds West of UTC), altzone (DST seconds west of UTC) and daylight (to 0 if this timezone does not have any daylight saving time rules, or to nonzero if there is a time, past, present or future when daylight saving time applies). Availability: Unix.  Note Although in many cases, changing the TZ environment variable may affect the output of functions like localtime() without calling tzset(), this behavior should not be relied on. The TZ environment variable should contain no whitespace.  The standard format of the TZ environment variable is (whitespace added for clarity): std offset [dst [offset [,start[/time], end[/time]]]]
 Where the components are:  
std and dst 

Three or more alphanumerics giving the timezone abbreviations. These will be propagated into time.tzname  
offset 

The offset has the form: ± hh[:mm[:ss]]. This indicates the value added the local time to arrive at UTC. If preceded by a ‘-‘, the timezone is east of the Prime Meridian; otherwise, it is west. If no offset follows dst, summer time is assumed to be one hour ahead of standard time.  
start[/time], end[/time] 

Indicates when to change to and back from DST. The format of the start and end dates are one of the following:  
Jn 

The Julian day n (1 <= n <= 365). Leap days are not counted, so in all years February 28 is day 59 and March 1 is day 60.  
n 

The zero-based Julian day (0 <= n <= 365). Leap days are counted, and it is possible to refer to February 29.  
Mm.n.d 

The d’th day (0 <= d <= 6) of week n of month m of the year (1 <= n <= 5, 1 <= m <= 12, where week 5 means “the last d day in month m” which may occur in either the fourth or the fifth week). Week 1 is the first week in which the d’th day occurs. Day zero is a Sunday.   time has the same format as offset except that no leading sign (‘-‘ or ‘+’) is allowed. The default, if time is not given, is 02:00:00.   >>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'
>>> time.tzset()
>>> time.strftime('%X %x %Z')
'02:07:36 05/08/03 EDT'
>>> os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'
>>> time.tzset()
>>> time.strftime('%X %x %Z')
'16:08:12 05/08/03 AEST'
 On many Unix systems (including *BSD, Linux, Solaris, and Darwin), it is more convenient to use the system’s zoneinfo (tzfile(5)) database to specify the timezone rules. To do this, set the TZ environment variable to the path of the required timezone datafile, relative to the root of the systems ‘zoneinfo’ timezone database, usually located at /usr/share/zoneinfo. For example, 'US/Eastern', 'Australia/Melbourne', 'Egypt' or 'Europe/Amsterdam'. >>> os.environ['TZ'] = 'US/Eastern'
>>> time.tzset()
>>> time.tzname
('EST', 'EDT')
>>> os.environ['TZ'] = 'Egypt'
>>> time.tzset()
>>> time.tzname
('EET', 'EEST')
timeit.default_timer()  
The default timer, which is always time.perf_counter().  Changed in version 3.3: time.perf_counter() is now the default timer.
timeit.repeat(stmt='pass', setup='pass', timer=<default timer>, repeat=5, number=1000000, globals=None)  
Create a Timer instance with the given statement, setup code and timer function and run its repeat() method with the given repeat count and number executions. The optional globals argument specifies a namespace in which to execute the code.  Changed in version 3.5: The optional globals parameter was added.   Changed in version 3.7: Default value of repeat changed from 3 to 5.
timeit.timeit(stmt='pass', setup='pass', timer=<default timer>, number=1000000, globals=None)  
Create a Timer instance with the given statement, setup code and timer function and run its timeit() method with number executions. The optional globals argument specifies a namespace in which to execute the code.  Changed in version 3.5: The optional globals parameter was added.
autorange(callback=None)  
Automatically determine how many times to call timeit(). This is a convenience function that calls timeit() repeatedly so that the total time >= 0.2 second, returning the eventual (number of loops, time taken for that number of loops). It calls timeit() with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, … until the time taken is at least 0.2 second. If callback is given and is not None, it will be called after each trial with two arguments: callback(number, time_taken).  New in version 3.6.
print_exc(file=None)  
Helper to print a traceback from the timed code. Typical use: t = Timer(...)       # outside the try/except
try:
    t.timeit(...)    # or t.repeat(...)
except Exception:
    t.print_exc()
 The advantage over the standard traceback is that source lines in the compiled template will be displayed. The optional file argument directs where the traceback is sent; it defaults to sys.stderr.
repeat(repeat=5, number=1000000)  
Call timeit() a few times. This is a convenience function that calls the timeit() repeatedly, returning a list of results. The first argument specifies how many times to call timeit(). The second argument specifies the number argument for timeit().  Note It’s tempting to calculate mean and standard deviation from the result vector and report these. However, this is not very useful. In a typical case, the lowest value gives a lower bound for how fast your machine can run the given code snippet; higher values in the result vector are typically not caused by variability in Python’s speed, but by other processes interfering with your timing accuracy. So the min() of the result is probably the only number you should be interested in. After that, you should look at the entire vector and apply common sense rather than statistics.   Changed in version 3.7: Default value of repeat changed from 3 to 5.
timeit(number=1000000)  
Time number executions of the main statement. This executes the setup statement once, and then returns the time it takes to execute the main statement a number of times, measured in seconds as a float. The argument is the number of times through the loop, defaulting to one million. The main statement, the setup statement and the timer function to be used are passed to the constructor.  Note By default, timeit() temporarily turns off garbage collection during the timing. The advantage of this approach is that it makes independent timings more comparable. The disadvantage is that GC may be an important component of the performance of the function being measured. If so, GC can be re-enabled as the first statement in the setup string. For example: timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()
exception TimeoutError  
Raised when a system function timed out at the system level. Corresponds to errno ETIMEDOUT.
tkinter.colorchooser — Color choosing dialog Source code: Lib/tkinter/colorchooser.py The tkinter.colorchooser module provides the Chooser class as an interface to the native color picker dialog. Chooser implements a modal color choosing dialog window. The Chooser class inherits from the Dialog class.  
class tkinter.colorchooser.Chooser(master=None, **options) 
  
tkinter.colorchooser.askcolor(color=None, **options)  
Create a color choosing dialog. A call to this method will show the window, wait for the user to make a selection, and return the selected color (or None) to the caller. 
  See also  
Module tkinter.commondialog


Tkinter standard dialog module
tkinter.colorchooser.askcolor(color=None, **options)  
Create a color choosing dialog. A call to this method will show the window, wait for the user to make a selection, and return the selected color (or None) to the caller.
class tkinter.commondialog.Dialog(master=None, **options)  
 
show(color=None, **options)  
Render the Dialog window.
tkinter.dnd — Drag and drop support Source code: Lib/tkinter/dnd.py  Note This is experimental and due to be deprecated when it is replaced with the Tk DND.  The tkinter.dnd module provides drag-and-drop support for objects within a single application, within the same window or between windows. To enable an object to be dragged, you must create an event binding for it that starts the drag-and-drop process. Typically, you bind a ButtonPress event to a callback function that you write (see Bindings and Events). The function should call dnd_start(), where ‘source’ is the object to be dragged, and ‘event’ is the event that invoked the call (the argument to your callback function). Selection of a target object occurs as follows:  Top-down search of area under mouse for target widget   Target widget should have a callable dnd_accept attribute If dnd_accept is not present or returns None, search moves to parent widget If no target widget is found, then the target object is None   Call to <old_target>.dnd_leave(source, event)
 Call to <new_target>.dnd_enter(source, event)
 Call to <target>.dnd_commit(source, event) to notify of drop Call to <source>.dnd_end(target, event) to signal end of drag-and-drop   
class tkinter.dnd.DndHandler(source, event)  
The DndHandler class handles drag-and-drop events tracking Motion and ButtonRelease events on the root of the event widget.  
cancel(event=None)  
Cancel the drag-and-drop process. 
  
finish(event, commit=0)  
Execute end of drag-and-drop functions. 
  
on_motion(event)  
Inspect area below mouse for target objects while drag is performed. 
  
on_release(event)  
Signal end of drag when the release pattern is triggered. 
 
  
tkinter.dnd.dnd_start(source, event)  
Factory function for drag-and-drop process. 
  See also Bindings and Events
class tkinter.dnd.DndHandler(source, event)  
The DndHandler class handles drag-and-drop events tracking Motion and ButtonRelease events on the root of the event widget.  
cancel(event=None)  
Cancel the drag-and-drop process. 
  
finish(event, commit=0)  
Execute end of drag-and-drop functions. 
  
on_motion(event)  
Inspect area below mouse for target objects while drag is performed. 
  
on_release(event)  
Signal end of drag when the release pattern is triggered.
on_motion(event)  
Inspect area below mouse for target objects while drag is performed.
tkinter.dnd.dnd_start(source, event)  
Factory function for drag-and-drop process.
tkinter.READABLE  
tkinter.WRITABLE  
tkinter.EXCEPTION  
Constants used in the mask arguments.
tkinter.filedialog.askopenfile(mode="r", **options)  
tkinter.filedialog.askopenfiles(mode="r", **options)  
The above two functions create an Open dialog and return the opened file object(s) in read-only mode.
tkinter.filedialog.askopenfilename(**options)  
tkinter.filedialog.askopenfilenames(**options)  
The above two functions create an Open dialog and return the selected filename(s) that correspond to existing file(s).
tkinter.filedialog.asksaveasfile(mode="w", **options)  
Create a SaveAs dialog and return a file object opened in write-only mode.
tkinter.filedialog.asksaveasfilename(**options)  
Create a SaveAs dialog and return the selected filename.
class tkinter.filedialog.Directory(master=None, **options)  
Create a dialog prompting the user to select a directory.
class tkinter.filedialog.FileDialog(master, title=None)  
Create a basic file selection dialog.  
cancel_command(event=None)  
Trigger the termination of the dialog window. 
  
dirs_double_event(event)  
Event handler for double-click event on directory. 
  
dirs_select_event(event)  
Event handler for click event on directory. 
  
files_double_event(event)  
Event handler for double-click event on file. 
  
files_select_event(event)  
Event handler for single-click event on file. 
  
filter_command(event=None)  
Filter the files by directory. 
  
get_filter()  
Retrieve the file filter currently in use. 
  
get_selection()  
Retrieve the currently selected item. 
  
go(dir_or_file=os.curdir, pattern="*", default="", key=None)  
Render dialog and start event loop. 
  
ok_event(event)  
Exit dialog returning current selection. 
  
quit(how=None)  
Exit dialog returning filename, if any. 
  
set_filter(dir, pat)  
Set the file filter. 
  
set_selection(file)  
Update the current file selection to file.
go(dir_or_file=os.curdir, pattern="*", default="", key=None)  
Render dialog and start event loop.
class tkinter.filedialog.LoadFileDialog(master, title=None)  
A subclass of FileDialog that creates a dialog window for selecting an existing file.  
ok_command()  
Test that a file is provided and that the selection indicates an already existing file.
ok_command()  
Test that a file is provided and that the selection indicates an already existing file.
class tkinter.filedialog.Open(master=None, **options)  
class tkinter.filedialog.SaveAs(master=None, **options)  
The above two classes provide native dialog windows for saving and loading files.
class tkinter.filedialog.SaveFileDialog(master, title=None)  
A subclass of FileDialog that creates a dialog window for selecting a destination file.  
ok_command()  
Test whether or not the selection points to a valid file that is not a directory. Confirmation is required if an already existing file is selected.
ok_command()  
Test whether or not the selection points to a valid file that is not a directory. Confirmation is required if an already existing file is selected.
tkinter.font — Tkinter font wrapper Source code: Lib/tkinter/font.py The tkinter.font module provides the Font class for creating and using named fonts. The different font weights and slants are:  
tkinter.font.NORMAL  
tkinter.font.BOLD  
tkinter.font.ITALIC  
tkinter.font.ROMAN 
  
class tkinter.font.Font(root=None, font=None, name=None, exists=False, **options)  
The Font class represents a named font. Font instances are given unique names and can be specified by their family, size, and style configuration. Named fonts are Tk’s method of creating and identifying fonts as a single object, rather than specifying a font by its attributes with each occurrence. arguments: additional keyword options (ignored if font is specified):  
actual(option=None, displayof=None)  
Return the attributes of the font. 
  
cget(option)  
Retrieve an attribute of the font. 
  
config(**options)  
Modify attributes of the font. 
  
copy()  
Return new instance of the current font. 
  
measure(text, displayof=None)  
Return amount of space the text would occupy on the specified display when formatted in the current font. If no display is specified then the main application window is assumed. 
  
metrics(*options, **kw)  
Return font-specific data. Options include:  
ascent - distance between baseline and highest point that a

character of the font can occupy  
descent - distance between baseline and lowest point that a

character of the font can occupy  
linespace - minimum vertical separation necessary between any two

characters of the font that ensures no vertical overlap between lines.   fixed - 1 if font is fixed-width else 0 
 
  
tkinter.font.families(root=None, displayof=None)  
Return the different font families. 
  
tkinter.font.names(root=None)  
Return the names of defined fonts. 
  
tkinter.font.nametofont(name)  
Return a Font representation of a tk named font.
tkinter.font.NORMAL  
tkinter.font.BOLD  
tkinter.font.ITALIC  
tkinter.font.ROMAN
tkinter.font.families(root=None, displayof=None)  
Return the different font families.
class tkinter.font.Font(root=None, font=None, name=None, exists=False, **options)  
The Font class represents a named font. Font instances are given unique names and can be specified by their family, size, and style configuration. Named fonts are Tk’s method of creating and identifying fonts as a single object, rather than specifying a font by its attributes with each occurrence. arguments: additional keyword options (ignored if font is specified):  
actual(option=None, displayof=None)  
Return the attributes of the font. 
  
cget(option)  
Retrieve an attribute of the font. 
  
config(**options)  
Modify attributes of the font. 
  
copy()  
Return new instance of the current font. 
  
measure(text, displayof=None)  
Return amount of space the text would occupy on the specified display when formatted in the current font. If no display is specified then the main application window is assumed. 
  
metrics(*options, **kw)  
Return font-specific data. Options include:  
ascent - distance between baseline and highest point that a

character of the font can occupy  
descent - distance between baseline and lowest point that a

character of the font can occupy  
linespace - minimum vertical separation necessary between any two

characters of the font that ensures no vertical overlap between lines.   fixed - 1 if font is fixed-width else 0
measure(text, displayof=None)  
Return amount of space the text would occupy on the specified display when formatted in the current font. If no display is specified then the main application window is assumed.
metrics(*options, **kw)  
Return font-specific data. Options include:  
ascent - distance between baseline and highest point that a

character of the font can occupy  
descent - distance between baseline and lowest point that a

character of the font can occupy  
linespace - minimum vertical separation necessary between any two

characters of the font that ensures no vertical overlap between lines.   fixed - 1 if font is fixed-width else 0
tkinter.font.nametofont(name)  
Return a Font representation of a tk named font.
tkinter.messagebox — Tkinter message prompts Source code: Lib/tkinter/messagebox.py The tkinter.messagebox module provides a template base class as well as a variety of convenience methods for commonly used configurations. The message boxes are modal and will return a subset of (True, False, OK, None, Yes, No) based on the user’s selection. Common message box styles and layouts include but are not limited to:     
class tkinter.messagebox.Message(master=None, **options)  
Create a default information message box. 
 Information message box  
tkinter.messagebox.showinfo(title=None, message=None, **options) 
 Warning message boxes  
tkinter.messagebox.showwarning(title=None, message=None, **options)  
tkinter.messagebox.showerror(title=None, message=None, **options) 
 Question message boxes  
tkinter.messagebox.askquestion(title=None, message=None, **options)  
tkinter.messagebox.askokcancel(title=None, message=None, **options)  
tkinter.messagebox.askretrycancel(title=None, message=None, **options)  
tkinter.messagebox.askyesno(title=None, message=None, **options)  
tkinter.messagebox.askyesnocancel(title=None, message=None, **options)
tkinter.messagebox.askquestion(title=None, message=None, **options)  
tkinter.messagebox.askokcancel(title=None, message=None, **options)  
tkinter.messagebox.askretrycancel(title=None, message=None, **options)  
tkinter.messagebox.askyesno(title=None, message=None, **options)  
tkinter.messagebox.askyesnocancel(title=None, message=None, **options)
class tkinter.messagebox.Message(master=None, **options)  
Create a default information message box.
tkinter.messagebox.showwarning(title=None, message=None, **options)  
tkinter.messagebox.showerror(title=None, message=None, **options)