neulab/docprompting-conala huggingface dataset:
theme_settings(themename, settings)  
Temporarily sets the current theme to themename, apply specified settings and then restore the previous theme. Each key in settings is a style and each value may contain the keys ‘configure’, ‘map’, ‘layout’ and ‘element create’ and they are expected to have the same format as specified by the methods Style.configure(), Style.map(), Style.layout() and Style.element_create() respectively. As an example, let’s change the Combobox for the default theme a bit: from tkinter import ttk
import tkinter

root = tkinter.Tk()

style = ttk.Style()
style.theme_settings("default", {
   "TCombobox": {
       "configure": {"padding": 5},
       "map": {
           "background": [("active", "green2"),
                          ("!disabled", "green4")],
           "fieldbackground": [("!disabled", "green3")],
           "foreground": [("focus", "OliveDrab1"),
                          ("!disabled", "OliveDrab2")]
       }
   }
})

combo = ttk.Combobox().pack()

root.mainloop()
theme_use(themename=None)  
If themename is not given, returns the theme in use. Otherwise, sets the current theme to themename, refreshes all widgets and emits a <<ThemeChanged>> event.
bbox(item, column=None)  
Returns the bounding box (relative to the treeview widget’s window) of the specified item in the form (x, y, width, height). If column is specified, returns the bounding box of that cell. If the item is not visible (i.e., if it is a descendant of a closed item or is scrolled offscreen), returns an empty string.
column(column, option=None, **kw)  
Query or modify the options for the specified column. If kw is not given, returns a dict of the column option values. If option is specified then the value for that option is returned. Otherwise, sets the options to the corresponding values. The valid options/values are:  
 id

Returns the column name. This is a read-only option.    
 anchor: One of the standard Tk anchor values.

Specifies how the text in this column should be aligned with respect to the cell.    
 minwidth: width

The minimum width of the column in pixels. The treeview widget will not make the column any smaller than specified by this option when the widget is resized or the user drags a column.    
 
stretch: True/False 

Specifies whether the column’s width should be adjusted when the widget is resized.    
 width: width

The width of the column in pixels.     To configure the tree column, call this with column = “#0”
delete(*items)  
Delete all specified items and all their descendants. The root item may not be deleted.
detach(*items)  
Unlinks all of the specified items from the tree. The items and all of their descendants are still present, and may be reinserted at another point in the tree, but will not be displayed. The root item may not be detached.
focus(item=None)  
If item is specified, sets the focus item to item. Otherwise, returns the current focus item, or ‘’ if there is none.
get_children(item=None)  
Returns the list of children belonging to item. If item is not specified, returns root children.
heading(column, option=None, **kw)  
Query or modify the heading options for the specified column. If kw is not given, returns a dict of the heading option values. If option is specified then the value for that option is returned. Otherwise, sets the options to the corresponding values. The valid options/values are:  
 text: text

The text to display in the column heading.    
 image: imageName

Specifies an image to display to the right of the column heading.    
 anchor: anchor

Specifies how the heading text should be aligned. One of the standard Tk anchor values.    
 command: callback

A callback to be invoked when the heading label is pressed.     To configure the tree column heading, call this with column = “#0”.
identify(component, x, y)  
Returns a description of the specified component under the point given by x and y, or the empty string if no such component is present at that position.
identify_column(x)  
Returns the data column identifier of the cell at position x. The tree column has ID #0.
identify_element(x, y)  
Returns the element at position x, y. Availability: Tk 8.6.
identify_region(x, y)  
Returns one of:   
region meaning   
heading Tree heading area.  
separator Space between two columns headings.  
tree The tree area.  
cell A data cell.   Availability: Tk 8.6.
insert(parent, index, iid=None, **kw)  
Creates a new item and returns the item identifier of the newly created item. parent is the item ID of the parent item, or the empty string to create a new top-level item. index is an integer, or the value “end”, specifying where in the list of parent’s children to insert the new item. If index is less than or equal to zero, the new node is inserted at the beginning; if index is greater than or equal to the current number of children, it is inserted at the end. If iid is specified, it is used as the item identifier; iid must not already exist in the tree. Otherwise, a new unique identifier is generated. See Item Options for the list of available points.
item(item, option=None, **kw)  
Query or modify the options for the specified item. If no options are given, a dict with options/values for the item is returned. If option is specified then the value for that option is returned. Otherwise, sets the options to the corresponding values as given by kw.
move(item, parent, index)  
Moves item to position index in parent’s list of children. It is illegal to move an item under one of its descendants. If index is less than or equal to zero, item is moved to the beginning; if greater than or equal to the number of children, it is moved to the end. If item was detached it is reattached.
next(item)  
Returns the identifier of item’s next sibling, or ‘’ if item is the last child of its parent.
parent(item)  
Returns the ID of the parent of item, or ‘’ if item is at the top level of the hierarchy.
prev(item)  
Returns the identifier of item’s previous sibling, or ‘’ if item is the first child of its parent.
reattach(item, parent, index)  
An alias for Treeview.move().
see(item)  
Ensure that item is visible. Sets all of item’s ancestors open option to True, and scrolls the widget if necessary so that item is within the visible portion of the tree.
selection()  
Returns a tuple of selected items.  Changed in version 3.8: selection() no longer takes arguments. For changing the selection state use the following selection methods.
selection_add(*items)  
Add items to the selection.  Changed in version 3.6: items can be passed as separate arguments, not just as a single tuple.
selection_remove(*items)  
Remove items from the selection.  Changed in version 3.6: items can be passed as separate arguments, not just as a single tuple.
selection_set(*items)  
items becomes the new selection.  Changed in version 3.6: items can be passed as separate arguments, not just as a single tuple.
selection_toggle(*items)  
Toggle the selection state of each item in items.  Changed in version 3.6: items can be passed as separate arguments, not just as a single tuple.
set(item, column=None, value=None)  
With one argument, returns a dictionary of column/value pairs for the specified item. With two arguments, returns the current value of the specified column. With three arguments, sets the value of given column in given item to the specified value.
set_children(item, *newchildren)  
Replaces item’s child with newchildren. Children present in item that are not present in newchildren are detached from the tree. No items in newchildren may be an ancestor of item. Note that not specifying newchildren results in detaching item’s children.
tag_bind(tagname, sequence=None, callback=None)  
Bind a callback for the given event sequence to the tag tagname. When an event is delivered to an item, the callbacks for each of the item’s tags option are called.
tag_configure(tagname, option=None, **kw)  
Query or modify the options for the specified tagname. If kw is not given, returns a dict of the option settings for tagname. If option is specified, returns the value for that option for the specified tagname. Otherwise, sets the options to the corresponding values for the given tagname.
tag_has(tagname, item=None)  
If item is specified, returns 1 or 0 depending on whether the specified item has the given tagname. Otherwise, returns a list of all items that have the specified tag. Availability: Tk 8.6
class tkinter.ttk.Widget  
 
identify(x, y)  
Returns the name of the element at position x y, or the empty string if the point does not lie within any element. x and y are pixel coordinates relative to the widget. 
  
instate(statespec, callback=None, *args, **kw)  
Test the widget’s state. If a callback is not specified, returns True if the widget state matches statespec and False otherwise. If callback is specified then it is called with args if widget state matches statespec. 
  
state(statespec=None)  
Modify or inquire widget state. If statespec is specified, sets the widget state according to it and return a new statespec indicating which flags were changed. If statespec is not specified, returns the currently-enabled state flags. 
 statespec will usually be a list or a tuple.
identify(x, y)  
Returns the name of the element at position x y, or the empty string if the point does not lie within any element. x and y are pixel coordinates relative to the widget.
instate(statespec, callback=None, *args, **kw)  
Test the widget’s state. If a callback is not specified, returns True if the widget state matches statespec and False otherwise. If callback is specified then it is called with args if widget state matches statespec.
state(statespec=None)  
Modify or inquire widget state. If statespec is specified, sets the widget state according to it and return a new statespec indicating which flags were changed. If statespec is not specified, returns the currently-enabled state flags.
Widget.tk.createfilehandler(file, mask, func)  
Registers the file handler callback function func. The file argument may either be an object with a fileno() method (such as a file or socket object), or an integer file descriptor. The mask argument is an ORed combination of any of the three constants below. The callback is called as follows: callback(file, mask)
Widget.tk.deletefilehandler(file)  
Unregisters a file handler.
token.ENCODING  
Token value that indicates the encoding used to decode the source bytes into text. The first token returned by tokenize.tokenize() will always be an ENCODING token.
token.ISEOF(x)  
Return True if x is the marker indicating the end of input.
token.ISNONTERMINAL(x)  
Return True for non-terminal token values.
token.NL  
Token value used to indicate a non-terminating newline. The NEWLINE token indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines.
token.tok_name  
Dictionary mapping the numeric values of the constants defined in this module back to name strings, allowing more human-readable representation of parse trees to be generated.
tokenize.detect_encoding(readline)  
The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (not decoded from bytes) it has read in. It detects the encoding from the presence of a UTF-8 BOM or an encoding cookie as specified in PEP 263. If both a BOM and a cookie are present, but disagree, a SyntaxError will be raised. Note that if the BOM is found, 'utf-8-sig' will be returned as an encoding. If no encoding is specified, then the default of 'utf-8' will be returned. Use open() to open Python source files: it uses detect_encoding() to detect the file encoding.
tokenize.generate_tokens(readline)  
Tokenize a source reading unicode strings instead of bytes. Like tokenize(), the readline argument is a callable returning a single line of input. However, generate_tokens() expects readline to return a str object rather than bytes. The result is an iterator yielding named tuples, exactly like tokenize(). It does not yield an ENCODING token.
tokenize.open(filename)  
Open a file in read only mode using the encoding detected by detect_encoding().  New in version 3.2.
exception tokenize.TokenError  
Raised when either a docstring or expression that may be split over several lines is not completed anywhere in the file, for example: """Beginning of
docstring
 or: [1,
 2,
 3
tokenize.tokenize(readline)  
The tokenize() generator requires one argument, readline, which must be a callable object which provides the same interface as the io.IOBase.readline() method of file objects. Each call to the function should return one line of input as bytes. The generator produces 5-tuples with these members: the token type; the token string; a 2-tuple (srow, scol) of ints specifying the row and column where the token begins in the source; a 2-tuple (erow, ecol) of ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed (the last tuple item) is the physical line. The 5 tuple is returned as a named tuple with the field names: type string start end line. The returned named tuple has an additional property named exact_type that contains the exact operator type for OP tokens. For all other token types exact_type equals the named tuple type field.  Changed in version 3.1: Added support for named tuples.   Changed in version 3.3: Added support for exact_type.  tokenize() determines the source encoding of the file by looking for a UTF-8 BOM or encoding cookie, according to PEP 263.
tokenize.untokenize(iterable)  
Converts tokens back into Python source code. The iterable must return sequences with at least two elements, the token type and the token string. Any additional sequence elements are ignored. The reconstructed script is returned as a single string. The result is guaranteed to tokenize back to match the input so that the conversion is lossless and round-trips are assured. The guarantee applies only to the token type and token string as the spacing between tokens (column positions) may change. It returns bytes, encoded using the ENCODING token, which is the first token sequence output by tokenize(). If there is no encoding token in the input, it returns a str instead.
class trace.CoverageResults  
A container for coverage results, created by Trace.results(). Should not be created directly by the user.  
update(other)  
Merge in data from another CoverageResults object. 
  
write_results(show_missing=True, summary=False, coverdir=None)  
Write coverage results. Set show_missing to show lines that had no hits. Set summary to include in the output the coverage summary per module. coverdir specifies the directory into which the coverage result files will be output. If None, the results for each source file are placed in its directory.
write_results(show_missing=True, summary=False, coverdir=None)  
Write coverage results. Set show_missing to show lines that had no hits. Set summary to include in the output the coverage summary per module. coverdir specifies the directory into which the coverage result files will be output. If None, the results for each source file are placed in its directory.
class trace.Trace(count=1, trace=1, countfuncs=0, countcallers=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None, timing=False)  
Create an object to trace execution of a single statement or expression. All parameters are optional. count enables counting of line numbers. trace enables line execution tracing. countfuncs enables listing of the functions called during the run. countcallers enables call relationship tracking. ignoremods is a list of modules or packages to ignore. ignoredirs is a list of directories whose modules or packages should be ignored. infile is the name of the file from which to read stored count information. outfile is the name of the file in which to write updated count information. timing enables a timestamp relative to when tracing was started to be displayed.  
run(cmd)  
Execute the command and gather statistics from the execution with the current tracing parameters. cmd must be a string or code object, suitable for passing into exec(). 
  
runctx(cmd, globals=None, locals=None)  
Execute the command and gather statistics from the execution with the current tracing parameters, in the defined global and local environments. If not defined, globals and locals default to empty dictionaries. 
  
runfunc(func, /, *args, **kwds)  
Call func with the given arguments under control of the Trace object with the current tracing parameters. 
  
results()  
Return a CoverageResults object that contains the cumulative results of all previous calls to run, runctx and runfunc for the given Trace instance. Does not reset the accumulated trace results.
results()  
Return a CoverageResults object that contains the cumulative results of all previous calls to run, runctx and runfunc for the given Trace instance. Does not reset the accumulated trace results.
run(cmd)  
Execute the command and gather statistics from the execution with the current tracing parameters. cmd must be a string or code object, suitable for passing into exec().
runctx(cmd, globals=None, locals=None)  
Execute the command and gather statistics from the execution with the current tracing parameters, in the defined global and local environments. If not defined, globals and locals default to empty dictionaries.
runfunc(func, /, *args, **kwds)  
Call func with the given arguments under control of the Trace object with the current tracing parameters.
traceback.clear_frames(tb)  
Clears the local variables of all the stack frames in a traceback tb by calling the clear() method of each frame object.  New in version 3.4.
traceback.extract_stack(f=None, limit=None)  
Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional f and limit arguments have the same meaning as for print_stack().
traceback.extract_tb(tb, limit=None)  
Return a StackSummary object representing a list of “pre-processed” stack trace entries extracted from the traceback object tb. It is useful for alternate formatting of stack traces. The optional limit argument has the same meaning as for print_tb(). A “pre-processed” stack trace entry is a FrameSummary object containing attributes filename, lineno, name, and line representing the information that is usually printed for a stack trace. The line is a string with leading and trailing whitespace stripped; if the source is not available it is None.
traceback.format_exc(limit=None, chain=True)  
This is like print_exc(limit) but returns a string instead of printing to a file.
traceback.format_exception(etype, value, tb, limit=None, chain=True)  
Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to print_exception(). The return value is a list of strings, each ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does print_exception().  Changed in version 3.5: The etype argument is ignored and inferred from the type of value.
traceback.format_exception_only(etype, value)  
Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred is the always last string in the list.
traceback.format_list(extracted_list)  
Given a list of tuples or FrameSummary objects as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same index in the argument list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not None.
traceback.format_stack(f=None, limit=None)  
A shorthand for format_list(extract_stack(f, limit)).
traceback.format_tb(tb, limit=None)  
A shorthand for format_list(extract_tb(tb, limit)).
class traceback.FrameSummary(filename, lineno, name, lookup_line=True, locals=None, line=None)  
Represent a single frame in the traceback or stack that is being formatted or printed. It may optionally have a stringified version of the frames locals included in it. If lookup_line is False, the source code is not looked up until the FrameSummary has the line attribute accessed (which also happens when casting it to a tuple). line may be directly provided, and will prevent line lookups happening at all. locals is an optional local variable dictionary, and if supplied the variable representations are stored in the summary for later display.
traceback.print_exc(limit=None, file=None, chain=True)  
This is a shorthand for print_exception(*sys.exc_info(), limit, file,
chain).
traceback.print_exception(etype, value, tb, limit=None, file=None, chain=True)  
Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways:  if tb is not None, it prints a header Traceback (most recent
call last):
 it prints the exception etype and value after the stack trace   if type(value) is SyntaxError and value has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error.  The optional limit argument has the same meaning as for print_tb(). If chain is true (the default), then chained exceptions (the __cause__ or __context__ attributes of the exception) will be printed as well, like the interpreter itself does when printing an unhandled exception.  Changed in version 3.5: The etype argument is ignored and inferred from the type of value.
traceback.print_last(limit=None, file=None, chain=True)  
This is a shorthand for print_exception(sys.last_type, sys.last_value,
sys.last_traceback, limit, file, chain). In general it will work only after an exception has reached an interactive prompt (see sys.last_type).
traceback.print_stack(f=None, limit=None, file=None)  
Print up to limit stack trace entries (starting from the invocation point) if limit is positive. Otherwise, print the last abs(limit) entries. If limit is omitted or None, all entries are printed. The optional f argument can be used to specify an alternate stack frame to start. The optional file argument has the same meaning as for print_tb().  Changed in version 3.5: Added negative limit support.
traceback.print_tb(tb, limit=None, file=None)  
Print up to limit stack trace entries from traceback object tb (starting from the caller’s frame) if limit is positive. Otherwise, print the last abs(limit) entries. If limit is omitted or None, all entries are printed. If file is omitted or None, the output goes to sys.stderr; otherwise it should be an open file or file-like object to receive the output.  Changed in version 3.5: Added negative limit support.