neulab/docprompting-conala huggingface dataset:
turtle.resizemode(rmode=None)  
 Parameters 
rmode – one of the strings “auto”, “user”, “noresize”   Set resizemode to one of the values: “auto”, “user”, “noresize”. If rmode is not given, return current resizemode. Different resizemodes have the following effects:  “auto”: adapts the appearance of the turtle corresponding to the value of pensize. “user”: adapts the appearance of the turtle according to the values of stretchfactor and outlinewidth (outline), which are set by shapesize(). “noresize”: no adaption of the turtle’s appearance takes place.  resizemode("user") is called by shapesize() when used with arguments. >>> turtle.resizemode()
'noresize'
>>> turtle.resizemode("auto")
>>> turtle.resizemode()
'auto'
turtle.right(angle)  
turtle.rt(angle)  
 Parameters 
angle – a number (integer or float)   Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle orientation depends on the turtle mode, see mode(). >>> turtle.heading()
22.0
>>> turtle.right(45)
>>> turtle.heading()
337.0
turtle.screensize(canvwidth=None, canvheight=None, bg=None)  
 Parameters 
 
canvwidth – positive integer, new width of canvas in pixels 
canvheight – positive integer, new height of canvas in pixels 
bg – colorstring or color-tuple, new background color    If no arguments are given, return current (canvaswidth, canvasheight). Else resize the canvas the turtles are drawing on. Do not alter the drawing window. To observe hidden parts of the canvas, use the scrollbars. With this method, one can make visible those parts of a drawing which were outside the canvas before. >>> screen.screensize()
(400, 300)
>>> screen.screensize(2000,1500)
>>> screen.screensize()
(2000, 1500)
 e.g. to search for an erroneously escaped turtle ;-)
class turtle.ScrolledCanvas(master)  
 Parameters 
master – some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas with scrollbars added   Used by class Screen, which thus automatically provides a ScrolledCanvas as playground for the turtles.
turtle.setheading(to_angle)  
turtle.seth(to_angle)  
 Parameters 
to_angle – a number (integer or float)   Set the orientation of the turtle to to_angle. Here are some common directions in degrees:   
standard mode logo mode   
0 - east 0 - north  
90 - north 90 - east  
180 - west 180 - south  
270 - south 270 - west   >>> turtle.setheading(90)
>>> turtle.heading()
90.0
turtle.settiltangle(angle)  
 Parameters 
angle – a number   Rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. Do not change the turtle’s heading (direction of movement). >>> turtle.reset()
>>> turtle.shape("circle")
>>> turtle.shapesize(5,2)
>>> turtle.settiltangle(45)
>>> turtle.fd(50)
>>> turtle.settiltangle(-45)
>>> turtle.fd(50)
  Deprecated since version 3.1.
turtle.setundobuffer(size)  
 Parameters 
size – an integer or None   Set or disable undobuffer. If size is an integer, an empty undobuffer of given size is installed. size gives the maximum number of turtle actions that can be undone by the undo() method/function. If size is None, the undobuffer is disabled. >>> turtle.setundobuffer(42)
turtle.setup(width=_CFG["width"], height=_CFG["height"], startx=_CFG["leftright"], starty=_CFG["topbottom"])  
Set the size and position of the main window. Default values of arguments are stored in the configuration dictionary and can be changed via a turtle.cfg file.  Parameters 
 
width – if an integer, a size in pixels, if a float, a fraction of the screen; default is 50% of screen 
height – if an integer, the height in pixels, if a float, a fraction of the screen; default is 75% of screen 
startx – if positive, starting position in pixels from the left edge of the screen, if negative from the right edge, if None, center window horizontally 
starty – if positive, starting position in pixels from the top edge of the screen, if negative from the bottom edge, if None, center window vertically    >>> screen.setup (width=200, height=200, startx=0, starty=0)
>>>              # sets window to 200x200 pixels, in upper left of screen
>>> screen.setup(width=.75, height=0.5, startx=None, starty=None)
>>>              # sets window to 75% of screen by 50% of screen and centers
turtle.setworldcoordinates(llx, lly, urx, ury)  
 Parameters 
 
llx – a number, x-coordinate of lower left corner of canvas 
lly – a number, y-coordinate of lower left corner of canvas 
urx – a number, x-coordinate of upper right corner of canvas 
ury – a number, y-coordinate of upper right corner of canvas    Set up user-defined coordinate system and switch to mode “world” if necessary. This performs a screen.reset(). If mode “world” is already active, all drawings are redrawn according to the new coordinates. ATTENTION: in user-defined coordinate systems angles may appear distorted. >>> screen.reset()
>>> screen.setworldcoordinates(-50,-7.5,50,7.5)
>>> for _ in range(72):
...     left(10)
...
>>> for _ in range(8):
...     left(45); fd(2)   # a regular octagon
turtle.setx(x)  
 Parameters 
x – a number (integer or float)   Set the turtle’s first coordinate to x, leave second coordinate unchanged. >>> turtle.position()
(0.00,240.00)
>>> turtle.setx(10)
>>> turtle.position()
(10.00,240.00)
turtle.sety(y)  
 Parameters 
y – a number (integer or float)   Set the turtle’s second coordinate to y, leave first coordinate unchanged. >>> turtle.position()
(0.00,40.00)
>>> turtle.sety(-10)
>>> turtle.position()
(0.00,-10.00)
class turtle.Shape(type_, data)  
 Parameters 
type_ – one of the strings “polygon”, “image”, “compound”   Data structure modeling shapes. The pair (type_, data) must follow this specification:   
type_ data   
“polygon” a polygon-tuple, i.e. a tuple of pairs of coordinates  
“image” an image (in this form only used internally!)  
“compound” None (a compound shape has to be constructed using the addcomponent() method)    
addcomponent(poly, fill, outline=None)  
 Parameters 
 
poly – a polygon, i.e. a tuple of pairs of numbers 
fill – a color the poly will be filled with 
outline – a color for the poly’s outline (if given)    Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
>>> s = Shape("compound")
>>> s.addcomponent(poly, "red", "blue")
>>> # ... add more components and then use register_shape()
 See Compound shapes.
turtle.shape(name=None)  
 Parameters 
name – a string which is a valid shapename   Set turtle shape to shape with given name or, if name is not given, return name of current shape. Shape with name must exist in the TurtleScreen’s shape dictionary. Initially there are the following polygon shapes: “arrow”, “turtle”, “circle”, “square”, “triangle”, “classic”. To learn about how to deal with shapes see Screen method register_shape(). >>> turtle.shape()
'classic'
>>> turtle.shape("turtle")
>>> turtle.shape()
'turtle'
addcomponent(poly, fill, outline=None)  
 Parameters 
 
poly – a polygon, i.e. a tuple of pairs of numbers 
fill – a color the poly will be filled with 
outline – a color for the poly’s outline (if given)    Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
>>> s = Shape("compound")
>>> s.addcomponent(poly, "red", "blue")
>>> # ... add more components and then use register_shape()
 See Compound shapes.
turtle.shapesize(stretch_wid=None, stretch_len=None, outline=None)  
turtle.turtlesize(stretch_wid=None, stretch_len=None, outline=None)  
 Parameters 
 
stretch_wid – positive number 
stretch_len – positive number 
outline – positive number    Return or set the pen’s attributes x/y-stretchfactors and/or outline. Set resizemode to “user”. If and only if resizemode is set to “user”, the turtle will be displayed stretched according to its stretchfactors: stretch_wid is stretchfactor perpendicular to its orientation, stretch_len is stretchfactor in direction of its orientation, outline determines the width of the shapes’s outline. >>> turtle.shapesize()
(1.0, 1.0, 1)
>>> turtle.resizemode("user")
>>> turtle.shapesize(5, 5, 12)
>>> turtle.shapesize()
(5, 5, 12)
>>> turtle.shapesize(outline=8)
>>> turtle.shapesize()
(5, 5, 8)
turtle.shapetransform(t11=None, t12=None, t21=None, t22=None)  
 Parameters 
 
t11 – a number (optional) 
t12 – a number (optional) 
t21 – a number (optional) 
t12 – a number (optional)    Set or return the current transformation matrix of the turtle shape. If none of the matrix elements are given, return the transformation matrix as a tuple of 4 elements. Otherwise set the given elements and transform the turtleshape according to the matrix consisting of first row t11, t12 and second row t21, t22. The determinant t11 * t22 - t12 * t21 must not be zero, otherwise an error is raised. Modify stretchfactor, shearfactor and tiltangle according to the given matrix. >>> turtle = Turtle()
>>> turtle.shape("square")
>>> turtle.shapesize(4,2)
>>> turtle.shearfactor(-0.5)
>>> turtle.shapetransform()
(4.0, -1.0, -0.0, 2.0)
turtle.shearfactor(shear=None)  
 Parameters 
shear – number (optional)   Set or return the current shearfactor. Shear the turtleshape according to the given shearfactor shear, which is the tangent of the shear angle. Do not change the turtle’s heading (direction of movement). If shear is not given: return the current shearfactor, i. e. the tangent of the shear angle, by which lines parallel to the heading of the turtle are sheared.  >>> turtle.shape("circle")
 >>> turtle.shapesize(5,2)
 >>> turtle.shearfactor(0.5)
 >>> turtle.shearfactor()
 0.5
turtle.showturtle()  
turtle.st()  
Make the turtle visible. >>> turtle.showturtle()
turtle.speed(speed=None)  
 Parameters 
speed – an integer in the range 0..10 or a speedstring (see below)   Set the turtle’s speed to an integer value in the range 0..10. If no argument is given, return current speed. If input is a number greater than 10 or smaller than 0.5, speed is set to 0. Speedstrings are mapped to speedvalues as follows:  “fastest”: 0 “fast”: 10 “normal”: 6 “slow”: 3 “slowest”: 1  Speeds from 1 to 10 enforce increasingly faster animation of line drawing and turtle turning. Attention: speed = 0 means that no animation takes place. forward/back makes turtle jump and likewise left/right make the turtle turn instantly. >>> turtle.speed()
3
>>> turtle.speed('normal')
>>> turtle.speed()
6
>>> turtle.speed(9)
>>> turtle.speed()
9
turtle.stamp()  
Stamp a copy of the turtle shape onto the canvas at the current turtle position. Return a stamp_id for that stamp, which can be used to delete it by calling clearstamp(stamp_id). >>> turtle.color("blue")
>>> turtle.stamp()
11
>>> turtle.fd(50)
turtle.textinput(title, prompt)  
 Parameters 
 
title – string 
prompt – string    Pop up a dialog window for input of a string. Parameter title is the title of the dialog window, prompt is a text mostly describing what information to input. Return the string input. If the dialog is canceled, return None. >>> screen.textinput("NIM", "Name of first player:")
turtle.tilt(angle)  
 Parameters 
angle – a number   Rotate the turtleshape by angle from its current tilt-angle, but do not change the turtle’s heading (direction of movement). >>> turtle.reset()
>>> turtle.shape("circle")
>>> turtle.shapesize(5,2)
>>> turtle.tilt(30)
>>> turtle.fd(50)
>>> turtle.tilt(30)
>>> turtle.fd(50)
turtle.tiltangle(angle=None)  
 Parameters 
angle – a number (optional)   Set or return the current tilt-angle. If angle is given, rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. Do not change the turtle’s heading (direction of movement). If angle is not given: return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle (its direction of movement). >>> turtle.reset()
>>> turtle.shape("circle")
>>> turtle.shapesize(5,2)
>>> turtle.tilt(45)
>>> turtle.tiltangle()
45.0
turtle.title(titlestring)  
 Parameters 
titlestring – a string that is shown in the titlebar of the turtle graphics window   Set title of turtle window to titlestring. >>> screen.title("Welcome to the turtle zoo!")
turtle.towards(x, y=None)  
 Parameters 
 
x – a number or a pair/vector of numbers or a turtle instance 
y – a number if x is a number, else None
    Return the angle between the line from turtle position to position specified by (x,y), the vector or the other turtle. This depends on the turtle’s start orientation which depends on the mode - “standard”/”world” or “logo”. >>> turtle.goto(10, 10)
>>> turtle.towards(0,0)
225.0
turtle.tracer(n=None, delay=None)  
 Parameters 
 
n – nonnegative integer 
delay – nonnegative integer    Turn turtle animation on/off and set delay for update drawings. If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) When called without arguments, returns the currently stored value of n. Second argument sets delay value (see delay()). >>> screen.tracer(8, 25)
>>> dist = 2
>>> for i in range(200):
...     fd(dist)
...     rt(90)
...     dist += 2
class turtle.Turtle  
Subclass of RawTurtle, has the same interface but draws on a default Screen object created automatically when needed for the first time.
turtle.turtles()  
Return the list of turtles on the screen. >>> for turtle in screen.turtles():
...     turtle.color("red")
class turtle.TurtleScreen(cv)  
 Parameters 
cv – a tkinter.Canvas   Provides screen oriented methods like setbg() etc. that are described above.
turtle.undo()  
Undo (repeatedly) the last turtle action(s). Number of available undo actions is determined by the size of the undobuffer. >>> for i in range(4):
...     turtle.fd(50); turtle.lt(80)
...
>>> for i in range(8):
...     turtle.undo()
turtle.undobufferentries()  
Return number of entries in the undobuffer. >>> while undobufferentries():
...     undo()
turtle.update()  
Perform a TurtleScreen update. To be used when tracer is turned off.
class turtle.Vec2D(x, y)  
A two-dimensional vector class, used as a helper class for implementing turtle graphics. May be useful for turtle graphics programs too. Derived from tuple, so a vector is a tuple! Provides (for a, b vectors, k number):  
a + b vector addition 
a - b vector subtraction 
a * b inner product 
k * a and a * k multiplication with scalar 
abs(a) absolute value of a 
a.rotate(angle) rotation
turtle.window_height()  
Return the height of the turtle window. >>> screen.window_height()
480
turtle.window_width()  
Return the width of the turtle window. >>> screen.window_width()
640
turtle.write(arg, move=False, align="left", font=("Arial", 8, "normal"))  
 Parameters 
 
arg – object to be written to the TurtleScreen 
move – True/False 
align – one of the strings “left”, “center” or right” 
font – a triple (fontname, fontsize, fonttype)    Write text - the string representation of arg - at the current turtle position according to align (“left”, “center” or “right”) and with the given font. If move is true, the pen is moved to the bottom-right corner of the text. By default, move is False. >>> turtle.write("Home = ", True, align="center")
>>> turtle.write((0,0), True)
turtle.write_docstringdict(filename="turtle_docstringdict")  
 Parameters 
filename – a string, used as filename   Create and write docstring-dictionary to a Python script with the given filename. This function has to be called explicitly (it is not used by the turtle graphics classes). The docstring dictionary will be written to the Python script filename.py. It is intended to serve as a template for translation of the docstrings into different languages.
turtle.xcor()  
Return the turtle’s x coordinate. >>> turtle.home()
>>> turtle.left(50)
>>> turtle.forward(100)
>>> turtle.pos()
(64.28,76.60)
>>> print(round(turtle.xcor(), 5))
64.27876
turtle.ycor()  
Return the turtle’s y coordinate. >>> turtle.home()
>>> turtle.left(60)
>>> turtle.forward(100)
>>> print(turtle.pos())
(50.00,86.60)
>>> print(round(turtle.ycor(), 5))
86.60254
class type(object)  
class type(name, bases, dict, **kwds)  
With one argument, return the type of an object. The return value is a type object and generally the same object as returned by object.__class__. The isinstance() built-in function is recommended for testing the type of an object, because it takes subclasses into account. With three arguments, return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the __name__ attribute. The bases tuple contains the base classes and becomes the __bases__ attribute; if empty, object, the ultimate base of all classes, is added. The dict dictionary contains attribute and method definitions for the class body; it may be copied or wrapped before becoming the __dict__ attribute. The following two statements create identical type objects: >>> class X:
...     a = 1
...
>>> X = type('X', (), dict(a=1))
 See also Type Objects. Keyword arguments provided to the three argument form are passed to the appropriate metaclass machinery (usually __init_subclass__()) in the same way that keywords in a class definition (besides metaclass) would. See also Customizing class creation.  Changed in version 3.6: Subclasses of type which don’t override type.__new__ may no longer use the one-argument form to get the type of an object.
exception TypeError  
Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. This exception may be raised by user code to indicate that an attempted operation on an object is not supported, and is not meant to be. If an object is meant to support a given operation but has not yet provided an implementation, NotImplementedError is the proper exception to raise. Passing arguments of the wrong type (e.g. passing a list when an int is expected) should result in a TypeError, but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in a ValueError.
types.AsyncGeneratorType  
The type of asynchronous generator-iterator objects, created by asynchronous generator functions.  New in version 3.6.
types.BuiltinFunctionType  
types.BuiltinMethodType  
The type of built-in functions like len() or sys.exit(), and methods of built-in classes. (Here, the term “built-in” means “written in C”.)
types.CellType  
The type for cell objects: such objects are used as containers for a function’s free variables.  New in version 3.8.
types.ClassMethodDescriptorType  
The type of unbound class methods of some built-in data types such as dict.__dict__['fromkeys'].  New in version 3.7.
class types.CodeType(**kwargs)  
The type for code objects such as returned by compile(). Raises an auditing event code.__new__ with arguments code, filename, name, argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags. Note that the audited arguments may not match the names or positions required by the initializer. The audit event only occurs for direct instantiation of code objects, and is not raised for normal compilation.  
replace(**kwargs)  
Return a copy of the code object with new values for the specified fields.  New in version 3.8.
replace(**kwargs)  
Return a copy of the code object with new values for the specified fields.  New in version 3.8.
types.coroutine(gen_func)  
This function transforms a generator function into a coroutine function which returns a generator-based coroutine. The generator-based coroutine is still a generator iterator, but is also considered to be a coroutine object and is awaitable. However, it may not necessarily implement the __await__() method. If gen_func is a generator function, it will be modified in-place. If gen_func is not a generator function, it will be wrapped. If it returns an instance of collections.abc.Generator, the instance will be wrapped in an awaitable proxy object. All other types of objects will be returned as is.  New in version 3.5.
types.CoroutineType  
The type of coroutine objects, created by async def functions.  New in version 3.5.
types.DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)  
Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class’s __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name (see enum.Enum for an example).  New in version 3.4.
types.FrameType  
The type of frame objects such as found in tb.tb_frame if tb is a traceback object. See the language reference for details of the available attributes and operations.
types.FunctionType  
types.LambdaType  
The type of user-defined functions and functions created by lambda expressions. Raises an auditing event function.__new__ with argument code. The audit event only occurs for direct instantiation of function objects, and is not raised for normal compilation.
class types.GenericAlias(t_origin, t_args)  
The type of parameterized generics such as list[int]. t_origin should be a non-parameterized generic class, such as list, tuple or dict. t_args should be a tuple (possibly of length 1) of types which parameterize t_origin: >>> from types import GenericAlias

>>> list[int] == GenericAlias(list, (int,))
True
>>> dict[str, int] == GenericAlias(dict, (str, int))
True
  New in version 3.9.   Changed in version 3.9.2: This type can now be subclassed.
types.GetSetDescriptorType  
The type of objects defined in extension modules with PyGetSetDef, such as FrameType.f_locals or array.array.typecode. This type is used as descriptor for object attributes; it has the same purpose as the property type, but for classes defined in extension modules.
class types.MappingProxyType(mapping)  
Read-only proxy of a mapping. It provides a dynamic view on the mapping’s entries, which means that when the mapping changes, the view reflects these changes.  New in version 3.3.   Changed in version 3.9: Updated to support the new union (|) operator from PEP 584, which simply delegates to the underlying mapping.   
key in proxy  
Return True if the underlying mapping has a key key, else False. 
  
proxy[key]  
Return the item of the underlying mapping with key key. Raises a KeyError if key is not in the underlying mapping. 
  
iter(proxy)  
Return an iterator over the keys of the underlying mapping. This is a shortcut for iter(proxy.keys()). 
  
len(proxy)  
Return the number of items in the underlying mapping. 
  
copy()  
Return a shallow copy of the underlying mapping. 
  
get(key[, default])  
Return the value for key if key is in the underlying mapping, else default. If default is not given, it defaults to None, so that this method never raises a KeyError. 
  
items()  
Return a new view of the underlying mapping’s items ((key, value) pairs). 
  
keys()  
Return a new view of the underlying mapping’s keys. 
  
values()  
Return a new view of the underlying mapping’s values. 
  
reversed(proxy)  
Return a reverse iterator over the keys of the underlying mapping.  New in version 3.9.
get(key[, default])  
Return the value for key if key is in the underlying mapping, else default. If default is not given, it defaults to None, so that this method never raises a KeyError.
items()  
Return a new view of the underlying mapping’s items ((key, value) pairs).
types.MemberDescriptorType  
The type of objects defined in extension modules with PyMemberDef, such as datetime.timedelta.days. This type is used as descriptor for simple C data members which use standard conversion functions; it has the same purpose as the property type, but for classes defined in extension modules.  CPython implementation detail: In other implementations of Python, this type may be identical to GetSetDescriptorType.
types.MethodDescriptorType  
The type of methods of some built-in data types such as str.join().  New in version 3.7.
types.MethodWrapperType  
The type of bound methods of some built-in data types and base classes. For example it is the type of object().__str__.  New in version 3.7.