source
stringclasses
2 values
version
stringclasses
2 values
module
stringclasses
53 values
function
stringclasses
318 values
input
stringlengths
3
496
expected
stringlengths
0
876
signature
stringclasses
41 values
cpython
3.10
turtle
TurtleScreen.clear
>>> screen.clear()
null
cpython
3.10
turtle
TurtleScreen.mode
>>> mode('logo') # resets turtle heading to north
null
cpython
3.10
turtle
TurtleScreen.mode
>>> mode()
'logo'
null
cpython
3.10
turtle
TurtleScreen.setworldcoordinates
>>> screen.setworldcoordinates(-10,-0.5,50,1.5)
null
cpython
3.10
turtle
TurtleScreen.setworldcoordinates
>>> for _ in range(36): ... left(10) ... forward(0.5)
null
cpython
3.10
turtle
TurtleScreen.register_shape
>>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))
null
cpython
3.10
turtle
TurtleScreen.colormode
>>> screen.colormode()
1.0
null
cpython
3.10
turtle
TurtleScreen.colormode
>>> screen.colormode(255)
null
cpython
3.10
turtle
TurtleScreen.colormode
>>> pencolor(240,160,80)
null
cpython
3.10
turtle
TurtleScreen.reset
>>> screen.reset()
null
cpython
3.10
turtle
TurtleScreen.turtles
>>> screen.turtles()
[<turtle.Turtle object at 0x00E11FB0>]
null
cpython
3.10
turtle
TurtleScreen.bgcolor
>>> screen.bgcolor("orange")
null
cpython
3.10
turtle
TurtleScreen.bgcolor
>>> screen.bgcolor()
'orange'
null
cpython
3.10
turtle
TurtleScreen.bgcolor
>>> screen.bgcolor(0.5,0,0.5)
null
cpython
3.10
turtle
TurtleScreen.bgcolor
>>> screen.bgcolor()
'#800080'
null
cpython
3.10
turtle
TurtleScreen.tracer
>>> screen.tracer(8, 25)
null
cpython
3.10
turtle
TurtleScreen.tracer
>>> dist = 2
null
cpython
3.10
turtle
TurtleScreen.tracer
>>> for i in range(200): ... fd(dist) ... rt(90) ... dist += 2
null
cpython
3.10
turtle
TurtleScreen.delay
>>> screen.delay(15)
null
cpython
3.10
turtle
TurtleScreen.delay
>>> screen.delay()
15
null
cpython
3.10
turtle
TurtleScreen.window_width
>>> screen.window_width()
640
null
cpython
3.10
turtle
TurtleScreen.window_height
>>> screen.window_height()
480
null
cpython
3.10
turtle
TurtleScreen.getcanvas
>>> cv = screen.getcanvas()
null
cpython
3.10
turtle
TurtleScreen.getcanvas
>>> cv
<turtle.ScrolledCanvas instance at 0x010742D8>
null
cpython
3.10
turtle
TurtleScreen.getshapes
>>> screen.getshapes()
['arrow', 'blank', 'circle', ... , 'turtle']
null
cpython
3.10
turtle
TurtleScreen.onclick
>>> screen.onclick(goto)
null
cpython
3.10
turtle
TurtleScreen.onclick
>>> # Subsequently clicking into the TurtleScreen will
null
cpython
3.10
turtle
TurtleScreen.onclick
>>> # make the turtle move to the clicked point.
null
cpython
3.10
turtle
TurtleScreen.onclick
>>> screen.onclick(None)
null
cpython
3.10
turtle
TurtleScreen.onkey
>>> def f(): ... fd(50) ... lt(60) ...
null
cpython
3.10
turtle
TurtleScreen.onkey
>>> screen.onkey(f, "Up")
null
cpython
3.10
turtle
TurtleScreen.onkey
>>> screen.listen()
null
cpython
3.10
turtle
TurtleScreen.onkeypress
>>> def f(): ... fd(50) ... lt(60) ...
null
cpython
3.10
turtle
TurtleScreen.onkeypress
>>> screen.onkeypress(f, "Up")
null
cpython
3.10
turtle
TurtleScreen.onkeypress
>>> screen.listen()
null
cpython
3.10
turtle
TurtleScreen.listen
>>> screen.listen()
null
cpython
3.10
turtle
TurtleScreen.ontimer
>>> running = True
null
cpython
3.10
turtle
TurtleScreen.ontimer
>>> def f(): ... if running: ... fd(50) ... lt(60) ... screen.ontimer(f, 250) ...
null
cpython
3.10
turtle
TurtleScreen.ontimer
>>> f() # makes the turtle marching around
null
cpython
3.10
turtle
TurtleScreen.ontimer
>>> running = False
null
cpython
3.10
turtle
TurtleScreen.bgpic
>>> screen.bgpic()
'nopic'
null
cpython
3.10
turtle
TurtleScreen.bgpic
>>> screen.bgpic("landscape.gif")
null
cpython
3.10
turtle
TurtleScreen.bgpic
>>> screen.bgpic()
'landscape.gif'
null
cpython
3.10
turtle
TurtleScreen.screensize
>>> turtle.screensize(2000,1500)
null
cpython
3.10
turtle
TurtleScreen.screensize
>>> # e.g. to search for an erroneously escaped turtle ;-)
null
cpython
3.10
turtle
TNavigator.degrees
>>> turtle.left(90)
null
cpython
3.10
turtle
TNavigator.degrees
>>> turtle.heading()
90
null
cpython
3.10
turtle
TNavigator.degrees
>>> turtle.degrees(400.0)
null
cpython
3.10
turtle
TNavigator.degrees
>>> turtle.heading()
100
null
cpython
3.10
turtle
TNavigator.radians
>>> turtle.heading()
90
null
cpython
3.10
turtle
TNavigator.radians
>>> turtle.radians()
null
cpython
3.10
turtle
TNavigator.radians
>>> turtle.heading()
1.5707963267948966
null
cpython
3.10
turtle
TNavigator.forward
>>> turtle.position()
(0.00, 0.00)
null
cpython
3.10
turtle
TNavigator.forward
>>> turtle.forward(25)
null
cpython
3.10
turtle
TNavigator.forward
>>> turtle.position()
(25.00,0.00)
null
cpython
3.10
turtle
TNavigator.forward
>>> turtle.forward(-75)
null
cpython
3.10
turtle
TNavigator.forward
>>> turtle.position()
(-50.00,0.00)
null
cpython
3.10
turtle
TNavigator.back
>>> turtle.position()
(0.00, 0.00)
null
cpython
3.10
turtle
TNavigator.back
>>> turtle.backward(30)
null
cpython
3.10
turtle
TNavigator.back
>>> turtle.position()
(-30.00, 0.00)
null
cpython
3.10
turtle
TNavigator.right
>>> turtle.heading()
22.0
null
cpython
3.10
turtle
TNavigator.right
>>> turtle.right(45)
null
cpython
3.10
turtle
TNavigator.right
>>> turtle.heading()
337.0
null
cpython
3.10
turtle
TNavigator.left
>>> turtle.heading()
22.0
null
cpython
3.10
turtle
TNavigator.left
>>> turtle.left(45)
null
cpython
3.10
turtle
TNavigator.left
>>> turtle.heading()
67.0
null
cpython
3.10
turtle
TNavigator.pos
>>> turtle.pos()
(0.00, 240.00)
null
cpython
3.10
turtle
TNavigator.xcor
>>> reset()
null
cpython
3.10
turtle
TNavigator.xcor
>>> turtle.left(60)
null
cpython
3.10
turtle
TNavigator.xcor
>>> turtle.forward(100)
null
cpython
3.10
turtle
TNavigator.xcor
>>> print turtle.xcor()
50.0
null
cpython
3.10
turtle
TNavigator.ycor
>>> reset()
null
cpython
3.10
turtle
TNavigator.ycor
>>> turtle.left(60)
null
cpython
3.10
turtle
TNavigator.ycor
>>> turtle.forward(100)
null
cpython
3.10
turtle
TNavigator.ycor
>>> print turtle.ycor()
86.6025403784
null
cpython
3.10
turtle
TNavigator.goto
>>> tp = turtle.pos()
null
cpython
3.10
turtle
TNavigator.goto
>>> tp
(0.00, 0.00)
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.setpos(60,30)
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.pos()
(60.00,30.00)
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.setpos((20,80))
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.pos()
(20.00,80.00)
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.setpos(tp)
null
cpython
3.10
turtle
TNavigator.goto
>>> turtle.pos()
(0.00,0.00)
null
cpython
3.10
turtle
TNavigator.home
>>> turtle.home()
null
cpython
3.10
turtle
TNavigator.setx
>>> turtle.position()
(0.00, 240.00)
null
cpython
3.10
turtle
TNavigator.setx
>>> turtle.setx(10)
null
cpython
3.10
turtle
TNavigator.setx
>>> turtle.position()
(10.00, 240.00)
null
cpython
3.10
turtle
TNavigator.sety
>>> turtle.position()
(0.00, 40.00)
null
cpython
3.10
turtle
TNavigator.sety
>>> turtle.sety(-10)
null
cpython
3.10
turtle
TNavigator.sety
>>> turtle.position()
(0.00, -10.00)
null
cpython
3.10
turtle
TNavigator.distance
>>> turtle.pos()
(0.00, 0.00)
null
cpython
3.10
turtle
TNavigator.distance
>>> turtle.distance(30,40)
50.0
null
cpython
3.10
turtle
TNavigator.distance
>>> pen = Turtle()
null
cpython
3.10
turtle
TNavigator.distance
>>> pen.forward(77)
null
cpython
3.10
turtle
TNavigator.distance
>>> turtle.distance(pen)
77.0
null
cpython
3.10
turtle
TNavigator.towards
>>> turtle.pos()
(10.00, 10.00)
null
cpython
3.10
turtle
TNavigator.towards
>>> turtle.towards(0,0)
225.0
null
cpython
3.10
turtle
TNavigator.heading
>>> turtle.left(67)
null
cpython
3.10
turtle
TNavigator.heading
>>> turtle.heading()
67.0
null
cpython
3.10
turtle
TNavigator.setheading
>>> turtle.setheading(90)
null