neulab/docprompting-conala huggingface dataset:
window.addstr(str[, attr])  
window.addstr(y, x, str[, attr])  
Paint the character string str at (y, x) with attributes attr, overwriting anything previously on the display.  Note  Writing outside the window, subwindow, or pad raises curses.error. Attempting to write to the lower right corner of a window, subwindow, or pad will cause an exception to be raised after the string is printed. A bug in ncurses, the backend for this Python module, can cause SegFaults when resizing windows. This is fixed in ncurses-6.1-20190511. If you are stuck with an earlier ncurses, you can avoid triggering this if you do not call addstr() with a str that has embedded newlines. Instead, call addstr() separately for each line.
window.attroff(attr)  
Remove attribute attr from the “background” set applied to all writes to the current window.
window.attron(attr)  
Add attribute attr from the “background” set applied to all writes to the current window.
window.attrset(attr)  
Set the “background” set of attributes to attr. This set is initially 0 (no attributes).
window.bkgd(ch[, attr])  
Set the background property of the window to the character ch, with attributes attr. The change is then applied to every character position in that window:  The attribute of every character in the window is changed to the new background attribute. Wherever the former background character appears, it is changed to the new background character.
window.bkgdset(ch[, attr])  
Set the window’s background. A window’s background consists of a character and any combination of attributes. The attribute part of the background is combined (OR’ed) with all non-blank characters that are written into the window. Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations.
window.border([ls[, rs[, ts[, bs[, tl[, tr[, bl[, br]]]]]]]])  
Draw a border around the edges of the window. Each parameter specifies the character to use for a specific part of the border; see the table below for more details.  Note A 0 value for any parameter will cause the default character to be used for that parameter. Keyword parameters can not be used. The defaults are listed in this table:    
Parameter Description Default value   
ls Left side ACS_VLINE  
rs Right side ACS_VLINE  
ts Top ACS_HLINE  
bs Bottom ACS_HLINE  
tl Upper-left corner ACS_ULCORNER  
tr Upper-right corner ACS_URCORNER  
bl Bottom-left corner ACS_LLCORNER  
br Bottom-right corner ACS_LRCORNER
window.box([vertch, horch])  
Similar to border(), but both ls and rs are vertch and both ts and bs are horch. The default corner characters are always used by this function.
window.chgat(attr)  
window.chgat(num, attr)  
window.chgat(y, x, attr)  
window.chgat(y, x, num, attr)  
Set the attributes of num characters at the current cursor position, or at position (y, x) if supplied. If num is not given or is -1, the attribute will be set on all the characters to the end of the line. This function moves cursor to position (y, x) if supplied. The changed line will be touched using the touchline() method so that the contents will be redisplayed by the next window refresh.
window.clear()  
Like erase(), but also cause the whole window to be repainted upon next call to refresh().
window.clearok(flag)  
If flag is True, the next call to refresh() will clear the window completely.
window.clrtobot()  
Erase from cursor to the end of the window: all lines below the cursor are deleted, and then the equivalent of clrtoeol() is performed.
window.clrtoeol()  
Erase from cursor to the end of the line.
window.cursyncup()  
Update the current cursor position of all the ancestors of the window to reflect the current cursor position of the window.
window.deleteln()  
Delete the line under the cursor. All following lines are moved up by one line.
window.derwin(begin_y, begin_x)  
window.derwin(nlines, ncols, begin_y, begin_x)  
An abbreviation for “derive window”, derwin() is the same as calling subwin(), except that begin_y and begin_x are relative to the origin of the window, rather than relative to the entire screen. Return a window object for the derived window.
window.echochar(ch[, attr])  
Add character ch with attribute attr, and immediately call refresh() on the window.
window.enclose(y, x)  
Test whether the given pair of screen-relative character-cell coordinates are enclosed by the given window, returning True or False. It is useful for determining what subset of the screen windows enclose the location of a mouse event.
window.encoding  
Encoding used to encode method arguments (Unicode strings and characters). The encoding attribute is inherited from the parent window when a subwindow is created, for example with window.subwin(). By default, the locale encoding is used (see locale.getpreferredencoding()).  New in version 3.3.
window.getbegyx()  
Return a tuple (y, x) of co-ordinates of upper-left corner.
window.getbkgd()  
Return the given window’s current background character/attribute pair.
window.getch([y, x])  
Get a character. Note that the integer returned does not have to be in ASCII range: function keys, keypad keys and so on are represented by numbers higher than 255. In no-delay mode, return -1 if there is no input, otherwise wait until a key is pressed.
window.getkey([y, x])  
Get a character, returning a string instead of an integer, as getch() does. Function keys, keypad keys and other special keys return a multibyte string containing the key name. In no-delay mode, raise an exception if there is no input.
window.getmaxyx()  
Return a tuple (y, x) of the height and width of the window.
window.getparyx()  
Return the beginning coordinates of this window relative to its parent window as a tuple (y, x). Return (-1, -1) if this window has no parent.
window.getstr()  
window.getstr(n)  
window.getstr(y, x)  
window.getstr(y, x, n)  
Read a bytes object from the user, with primitive line editing capacity.
window.getyx()  
Return a tuple (y, x) of current cursor position relative to the window’s upper-left corner.
window.get_wch([y, x])  
Get a wide character. Return a character for most keys, or an integer for function keys, keypad keys, and other special keys. In no-delay mode, raise an exception if there is no input.  New in version 3.3.
window.hline(ch, n)  
window.hline(y, x, ch, n)  
Display a horizontal line starting at (y, x) with length n consisting of the character ch.
window.idcok(flag)  
If flag is False, curses no longer considers using the hardware insert/delete character feature of the terminal; if flag is True, use of character insertion and deletion is enabled. When curses is first initialized, use of character insert/delete is enabled by default.
window.idlok(flag)  
If flag is True, curses will try and use hardware line editing facilities. Otherwise, line insertion/deletion are disabled.
window.immedok(flag)  
If flag is True, any change in the window image automatically causes the window to be refreshed; you no longer have to call refresh() yourself. However, it may degrade performance considerably, due to repeated calls to wrefresh. This option is disabled by default.
window.inch([y, x])  
Return the character at the given position in the window. The bottom 8 bits are the character proper, and upper bits are the attributes.
window.insch(ch[, attr])  
window.insch(y, x, ch[, attr])  
Paint character ch at (y, x) with attributes attr, moving the line from position x right by one character.
window.insdelln(nlines)  
Insert nlines lines into the specified window above the current line. The nlines bottom lines are lost. For negative nlines, delete nlines lines starting with the one under the cursor, and move the remaining lines up. The bottom nlines lines are cleared. The current cursor position remains the same.
window.insertln()  
Insert a blank line under the cursor. All following lines are moved down by one line.
window.insnstr(str, n[, attr])  
window.insnstr(y, x, str, n[, attr])  
Insert a character string (as many characters as will fit on the line) before the character under the cursor, up to n characters. If n is zero or negative, the entire string is inserted. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to y, x, if specified).
window.insstr(str[, attr])  
window.insstr(y, x, str[, attr])  
Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to y, x, if specified).
window.instr([n])  
window.instr(y, x[, n])  
Return a bytes object of characters, extracted from the window starting at the current cursor position, or at y, x if specified. Attributes are stripped from the characters. If n is specified, instr() returns a string at most n characters long (exclusive of the trailing NUL).
window.is_linetouched(line)  
Return True if the specified line was modified since the last call to refresh(); otherwise return False. Raise a curses.error exception if line is not valid for the given window.
window.is_wintouched()  
Return True if the specified window was modified since the last call to refresh(); otherwise return False.
window.keypad(flag)  
If flag is True, escape sequences generated by some keys (keypad, function keys) will be interpreted by curses. If flag is False, escape sequences will be left as is in the input stream.
window.leaveok(flag)  
If flag is True, cursor is left where it is on update, instead of being at “cursor position.” This reduces cursor movement where possible. If possible the cursor will be made invisible. If flag is False, cursor will always be at “cursor position” after an update.
window.move(new_y, new_x)  
Move cursor to (new_y, new_x).
window.mvderwin(y, x)  
Move the window inside its parent window. The screen-relative parameters of the window are not changed. This routine is used to display different parts of the parent window at the same physical position on the screen.
window.mvwin(new_y, new_x)  
Move the window so its upper-left corner is at (new_y, new_x).
window.nodelay(flag)  
If flag is True, getch() will be non-blocking.
window.notimeout(flag)  
If flag is True, escape sequences will not be timed out. If flag is False, after a few milliseconds, an escape sequence will not be interpreted, and will be left in the input stream as is.
window.noutrefresh()  
Mark for refresh but wait. This function updates the data structure representing the desired state of the window, but does not force an update of the physical screen. To accomplish that, call doupdate().
window.overlay(destwin[, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol])  
Overlay the window on top of destwin. The windows need not be the same size, only the overlapping region is copied. This copy is non-destructive, which means that the current background character does not overwrite the old contents of destwin. To get fine-grained control over the copied region, the second form of overlay() can be used. sminrow and smincol are the upper-left coordinates of the source window, and the other variables mark a rectangle in the destination window.
window.overwrite(destwin[, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol])  
Overwrite the window on top of destwin. The windows need not be the same size, in which case only the overlapping region is copied. This copy is destructive, which means that the current background character overwrites the old contents of destwin. To get fine-grained control over the copied region, the second form of overwrite() can be used. sminrow and smincol are the upper-left coordinates of the source window, the other variables mark a rectangle in the destination window.
window.putwin(file)  
Write all data associated with the window into the provided file object. This information can be later retrieved using the getwin() function.
window.redrawln(beg, num)  
Indicate that the num screen lines, starting at line beg, are corrupted and should be completely redrawn on the next refresh() call.
window.redrawwin()  
Touch the entire window, causing it to be completely redrawn on the next refresh() call.
window.refresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])  
Update the display immediately (sync actual screen with previous drawing/deleting methods). The 6 optional arguments can only be specified when the window is a pad created with newpad(). The additional parameters are needed to indicate what part of the pad and screen are involved. pminrow and pmincol specify the upper left-hand corner of the rectangle to be displayed in the pad. sminrow, smincol, smaxrow, and smaxcol specify the edges of the rectangle to be displayed on the screen. The lower right-hand corner of the rectangle to be displayed in the pad is calculated from the screen coordinates, since the rectangles must be the same size. Both rectangles must be entirely contained within their respective structures. Negative values of pminrow, pmincol, sminrow, or smincol are treated as if they were zero.
window.resize(nlines, ncols)  
Reallocate storage for a curses window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window’s data is filled with blanks that have the current background rendition (as set by bkgdset()) merged into them.
window.scroll([lines=1])  
Scroll the screen or scrolling region upward by lines lines.
window.scrollok(flag)  
Control what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If flag is False, the cursor is left on the bottom line. If flag is True, the window is scrolled up one line. Note that in order to get the physical scrolling effect on the terminal, it is also necessary to call idlok().
window.setscrreg(top, bottom)  
Set the scrolling region from line top to line bottom. All scrolling actions will take place in this region.
window.standend()  
Turn off the standout attribute. On some terminals this has the side effect of turning off all attributes.
window.subpad(begin_y, begin_x)  
window.subpad(nlines, ncols, begin_y, begin_x)  
Return a sub-window, whose upper-left corner is at (begin_y, begin_x), and whose width/height is ncols/nlines.
window.subwin(begin_y, begin_x)  
window.subwin(nlines, ncols, begin_y, begin_x)  
Return a sub-window, whose upper-left corner is at (begin_y, begin_x), and whose width/height is ncols/nlines. By default, the sub-window will extend from the specified position to the lower right corner of the window.
window.syncdown()  
Touch each location in the window that has been touched in any of its ancestor windows. This routine is called by refresh(), so it should almost never be necessary to call it manually.
window.syncok(flag)  
If flag is True, then syncup() is called automatically whenever there is a change in the window.
window.syncup()  
Touch all locations in ancestors of the window that have been changed in the window.
window.timeout(delay)  
Set blocking or non-blocking read behavior for the window. If delay is negative, blocking read is used (which will wait indefinitely for input). If delay is zero, then non-blocking read is used, and getch() will return -1 if no input is waiting. If delay is positive, then getch() will block for delay milliseconds, and return -1 if there is still no input at the end of that time.
window.touchline(start, count[, changed])  
Pretend count lines have been changed, starting with line start. If changed is supplied, it specifies whether the affected lines are marked as having been changed (changed=True) or unchanged (changed=False).
window.touchwin()  
Pretend the whole window has been changed, for purposes of drawing optimizations.
window.untouchwin()  
Mark all lines in the window as unchanged since the last call to refresh().
window.vline(ch, n)  
window.vline(y, x, ch, n)  
Display a vertical line starting at (y, x) with length n consisting of the character ch.
curses.wrapper(func, /, *args, **kwargs)  
Initialize curses and call another callable object, func, which should be the rest of your curses-using application. If the application raises an exception, this function will restore the terminal to a sane state before re-raising the exception and generating a traceback. The callable object func is then passed the main window ‘stdscr’ as its first argument, followed by any other arguments passed to wrapper(). Before calling func, wrapper() turns on cbreak mode, turns off echo, enables the terminal keypad, and initializes colors if the terminal has color support. On exit (whether normally or by exception) it restores cooked mode, turns on echo, and disables the terminal keypad.
dataclasses.asdict(instance, *, dict_factory=dict)  
Converts the dataclass instance to a dict (by using the factory function dict_factory). Each dataclass is converted to a dict of its fields, as name: value pairs. dataclasses, dicts, lists, and tuples are recursed into. For example: @dataclass
class Point:
     x: int
     y: int

@dataclass
class C:
     mylist: list[Point]

p = Point(10, 20)
assert asdict(p) == {'x': 10, 'y': 20}

c = C([Point(0, 0), Point(10, 4)])
assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}
 Raises TypeError if instance is not a dataclass instance.
dataclasses.astuple(instance, *, tuple_factory=tuple)  
Converts the dataclass instance to a tuple (by using the factory function tuple_factory). Each dataclass is converted to a tuple of its field values. dataclasses, dicts, lists, and tuples are recursed into. Continuing from the previous example: assert astuple(p) == (10, 20)
assert astuple(c) == ([(0, 0), (10, 4)],)
 Raises TypeError if instance is not a dataclass instance.
class dataclasses.Field  
Field objects describe each defined field. These objects are created internally, and are returned by the fields() module-level method (see below). Users should never instantiate a Field object directly. Its documented attributes are:  
name: The name of the field. 
type: The type of the field. 
default, default_factory, init, repr, hash, compare, and metadata have the identical meaning and values as they do in the field() declaration.  Other attributes may exist, but they are private and must not be inspected or relied on.
dataclasses.fields(class_or_instance)  
Returns a tuple of Field objects that define the fields for this dataclass. Accepts either a dataclass, or an instance of a dataclass. Raises TypeError if not passed a dataclass or instance of one. Does not return pseudo-fields which are ClassVar or InitVar.
exception dataclasses.FrozenInstanceError  
Raised when an implicitly defined __setattr__() or __delattr__() is called on a dataclass which was defined with frozen=True. It is a subclass of AttributeError.
dataclasses.is_dataclass(class_or_instance)  
Return True if its parameter is a dataclass or an instance of one, otherwise return False. If you need to know if a class is an instance of a dataclass (and not a dataclass itself), then add a further check for not
isinstance(obj, type): def is_dataclass_instance(obj):
    return is_dataclass(obj) and not isinstance(obj, type)
dataclasses.make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)  
Creates a new dataclass with name cls_name, fields as defined in fields, base classes as given in bases, and initialized with a namespace as given in namespace. fields is an iterable whose elements are each either name, (name, type), or (name, type, Field). If just name is supplied, typing.Any is used for type. The values of init, repr, eq, order, unsafe_hash, and frozen have the same meaning as they do in dataclass(). This function is not strictly required, because any Python mechanism for creating a new class with __annotations__ can then apply the dataclass() function to convert that class to a dataclass. This function is provided as a convenience. For example: C = make_dataclass('C',
                   [('x', int),
                     'y',
                    ('z', int, field(default=5))],
                   namespace={'add_one': lambda self: self.x + 1})
 Is equivalent to: @dataclass
class C:
    x: int
    y: 'typing.Any'
    z: int = 5

    def add_one(self):
        return self.x + 1
dataclasses.replace(instance, /, **changes)  
Creates a new object of the same type of instance, replacing fields with values from changes. If instance is not a Data Class, raises TypeError. If values in changes do not specify fields, raises TypeError. The newly returned object is created by calling the __init__() method of the dataclass. This ensures that __post_init__(), if present, is also called. Init-only variables without default values, if any exist, must be specified on the call to replace() so that they can be passed to __init__() and __post_init__(). It is an error for changes to contain any fields that are defined as having init=False. A ValueError will be raised in this case. Be forewarned about how init=False fields work during a call to replace(). They are not copied from the source object, but rather are initialized in __post_init__(), if they’re initialized at all. It is expected that init=False fields will be rarely and judiciously used. If they are used, it might be wise to have alternate class constructors, or perhaps a custom replace() (or similarly named) method which handles instance copying.
class datetime.date(year, month, day)  
All arguments are required. Arguments must be integers, in the following ranges:  MINYEAR <= year <= MAXYEAR 1 <= month <= 12 1 <= day <= number of days in the given month and year  If an argument outside those ranges is given, ValueError is raised.
date.ctime()  
Return a string representing the date: >>> from datetime import date
>>> date(2002, 12, 4).ctime()
'Wed Dec  4 00:00:00 2002'
 d.ctime() is equivalent to: time.ctime(time.mktime(d.timetuple()))
 on platforms where the native C ctime() function (which time.ctime() invokes, but which date.ctime() does not invoke) conforms to the C standard.
date.day  
Between 1 and the number of days in the given month of the given year.
classmethod date.fromisocalendar(year, week, day)  
Return a date corresponding to the ISO calendar date specified by year, week and day. This is the inverse of the function date.isocalendar().  New in version 3.8.
classmethod date.fromisoformat(date_string)  
Return a date corresponding to a date_string given in the format YYYY-MM-DD: >>> from datetime import date
>>> date.fromisoformat('2019-12-04')
datetime.date(2019, 12, 4)
 This is the inverse of date.isoformat(). It only supports the format YYYY-MM-DD.  New in version 3.7.
classmethod date.fromordinal(ordinal)  
Return the date corresponding to the proleptic Gregorian ordinal, where January 1 of year 1 has ordinal 1. ValueError is raised unless 1 <= ordinal <=
date.max.toordinal(). For any date d, date.fromordinal(d.toordinal()) == d.
classmethod date.fromtimestamp(timestamp)  
Return the local date corresponding to the POSIX timestamp, such as is returned by time.time(). This may raise OverflowError, if the timestamp is out of the range of values supported by the platform C localtime() function, and OSError on localtime() failure. It’s common for this to be restricted to years from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by fromtimestamp().  Changed in version 3.3: Raise OverflowError instead of ValueError if the timestamp is out of the range of values supported by the platform C localtime() function. Raise OSError instead of ValueError on localtime() failure.