neulab/docprompting-conala huggingface dataset:
pygame.draw.arc() 
 draw an elliptical arc arc(surface, color, rect, start_angle, stop_angle) -> Rect arc(surface, color, rect, start_angle, stop_angle, width=1) -> Rect  Draws an elliptical arc on the given surface. The two angle arguments are given in radians and indicate the start and stop positions of the arc. The arc is drawn in a counterclockwise direction from the start_angle to the stop_angle.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
rect (Rect) -- rectangle to indicate the position and dimensions of the ellipse which the arc will be based on, the ellipse will be centered inside the rectangle 
start_angle (float) -- start angle of the arc in radians 
stop_angle (float) -- stop angle of the arc in radians  
 if start_angle < stop_angle, the arc is drawn in a counterclockwise direction from the start_angle to the stop_angle
 if start_angle > stop_angle, tau (tau == 2 * pi) will be added to the stop_angle, if the resulting stop angle value is greater than the start_angle the above start_angle < stop_angle case applies, otherwise nothing will be drawn if start_angle == stop_angle, nothing will be drawn   
  
width (int) -- (optional) used for line thickness (not to be confused with the width value of the rect parameter)  
 if width == 0, nothing will be drawn if width > 0, (default is 1) used for line thickness if width < 0, same as width == 0
   Note When using width values > 1, the edge lines will only grow inward from the original boundary of the rect parameter.  
     
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the given rect parameter and its width and height will be 0   
Return type:

Rect      Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.circle() 
 draw a circle circle(surface, color, center, radius) -> Rect circle(surface, color, center, radius, width=0, draw_top_right=None, draw_top_left=None, draw_bottom_left=None, draw_bottom_right=None) -> Rect  Draws a circle on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
center (tuple(int or float, int or float) or list(int or float, int or float) or Vector2(int or float, int or float)) -- center point of the circle as a sequence of 2 ints/floats, e.g. (x, y)
 
radius (int or float) -- radius of the circle, measured from the center parameter, nothing will be drawn if the radius is less than 1 
width (int) -- (optional) used for line thickness or to indicate that the circle is to be filled  
 if width == 0, (default) fill the circle if width > 0, used for line thickness if width < 0, nothing will be drawn    Note When using width values > 1, the edge lines will only grow inward.  
  
draw_top_right (bool) -- (optional) if this is set to True then the top right corner of the circle will be drawn 
draw_top_left (bool) -- (optional) if this is set to True then the top left corner of the circle will be drawn 
draw_bottom_left (bool) -- (optional) if this is set to True then the bottom left corner of the circle will be drawn 
draw_bottom_right (bool) -- (optional) if this is set to True then the bottom right corner of the circle will be drawn  
 if any of the draw_circle_part is True then it will draw all circle parts that have the True value, otherwise it will draw the entire circle.  
     
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the center parameter value (float values will be truncated) and its width and height will be 0   
Return type:

Rect   
Raises:

 
TypeError -- if center is not a sequence of two numbers 
TypeError -- if radius is not a number       Changed in pygame 2.0.0: Added support for keyword arguments. Nothing is drawn when the radius is 0 (a pixel at the center coordinates used to be drawn when the radius equaled 0). Floats, and Vector2 are accepted for the center param. The drawing algorithm was improved to look more like a circle.   Changed in pygame 2.0.0.dev8: Added support for drawing circle quadrants.
pygame.draw.ellipse() 
 draw an ellipse ellipse(surface, color, rect) -> Rect ellipse(surface, color, rect, width=0) -> Rect  Draws an ellipse on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
rect (Rect) -- rectangle to indicate the position and dimensions of the ellipse, the ellipse will be centered inside the rectangle and bounded by it 
width (int) -- (optional) used for line thickness or to indicate that the ellipse is to be filled (not to be confused with the width value of the rect parameter)  
 if width == 0, (default) fill the ellipse if width > 0, used for line thickness if width < 0, nothing will be drawn    Note When using width values > 1, the edge lines will only grow inward from the original boundary of the rect parameter.  
     
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the given rect parameter and its width and height will be 0   
Return type:

Rect      Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.line() 
 draw a straight line line(surface, color, start_pos, end_pos, width) -> Rect line(surface, color, start_pos, end_pos, width=1) -> Rect  Draws a straight line on the given surface. There are no endcaps. For thick lines the ends are squared off.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
start_pos (tuple(int or float, int or float) or list(int or float, int or float) or Vector2(int or float, int or float)) -- start position of the line, (x, y) 
end_pos (tuple(int or float, int or float) or list(int or float, int or float) or Vector2(int or float, int or float)) -- end position of the line, (x, y) 
width (int) -- (optional) used for line thickness  if width >= 1, used for line thickness (default is 1) if width < 1, nothing will be drawn    Note When using width values > 1, lines will grow as follows. For odd width values, the thickness of each line grows with the original line being in the center. For even width values, the thickness of each line grows with the original line being offset from the center (as there is no exact center line drawn). As a result, lines with a slope < 1 (horizontal-ish) will have 1 more pixel of thickness below the original line (in the y direction). Lines with a slope >= 1 (vertical-ish) will have 1 more pixel of thickness to the right of the original line (in the x direction).      
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the start_pos parameter value (float values will be truncated) and its width and height will be 0   
Return type:

Rect   
Raises:

TypeError -- if start_pos or end_pos is not a sequence of two numbers      Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.lines() 
 draw multiple contiguous straight line segments lines(surface, color, closed, points) -> Rect lines(surface, color, closed, points, width=1) -> Rect  Draws a sequence of contiguous straight lines on the given surface. There are no endcaps or miter joints. For thick lines the ends are squared off. Drawing thick lines with sharp corners can have undesired looking results.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
closed (bool) -- if True an additional line segment is drawn between the first and last points in the points sequence 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 2 or more (x, y) coordinates, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats and adjacent coordinates will be connected by a line segment, e.g. for the points [(x1, y1), (x2, y2), (x3, y3)] a line segment will be drawn from (x1, y1) to (x2, y2) and from (x2, y2) to (x3, y3), additionally if the closed parameter is True another line segment will be drawn from (x3, y3) to (x1, y1)
 
width (int) -- (optional) used for line thickness  if width >= 1, used for line thickness (default is 1) if width < 1, nothing will be drawn    Note When using width values > 1 refer to the width notes of line() for details on how thick lines grow.      
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the first point in the points parameter (float values will be truncated) and its width and height will be 0   
Return type:

Rect   
Raises:

 
ValueError -- if len(points) < 2 (must have at least 2 points) 
TypeError -- if points is not a sequence or points does not contain number pairs       Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.polygon() 
 draw a polygon polygon(surface, color, points) -> Rect polygon(surface, color, points, width=0) -> Rect  Draws a polygon on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates that make up the vertices of the polygon, each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats, e.g. [(x1, y1), (x2, y2), (x3, y3)]
 
width (int) -- (optional) used for line thickness or to indicate that the polygon is to be filled  
 if width == 0, (default) fill the polygon if width > 0, used for line thickness if width < 0, nothing will be drawn    Note When using width values > 1, the edge lines will grow outside the original boundary of the polygon. For more details on how the thickness for edge lines grow, refer to the width notes of the pygame.draw.line() function.  
     
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the first point in the points parameter (float values will be truncated) and its width and height will be 0   
Return type:

Rect   
Raises:

 
ValueError -- if len(points) < 3 (must have at least 3 points) 
TypeError -- if points is not a sequence or points does not contain number pairs       Note For an aapolygon, use aalines() with closed=True.   Changed in pygame 2.0.0: Added support for keyword arguments.
pygame.draw.rect() 
 draw a rectangle rect(surface, color, rect) -> Rect rect(surface, color, rect, width=0, border_radius=0, border_top_left_radius=-1, border_top_right_radius=-1, border_bottom_left_radius=-1, border_bottom_right_radius=-1) -> Rect  Draws a rectangle on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
color (Color or int or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
 
rect (Rect) -- rectangle to draw, position and dimensions 
width (int) -- (optional) used for line thickness or to indicate that the rectangle is to be filled (not to be confused with the width value of the rect parameter)  
 if width == 0, (default) fill the rectangle if width > 0, used for line thickness if width < 0, nothing will be drawn    Note When using width values > 1, the edge lines will grow outside the original boundary of the rect. For more details on how the thickness for edge lines grow, refer to the width notes of the pygame.draw.line() function.  
  
border_radius (int) -- (optional) used for drawing rectangle with rounded corners. The supported range is [0, min(height, width) / 2], with 0 representing a rectangle without rounded corners. 
border_top_left_radius (int) -- (optional) used for setting the value of top left border. If you don't set this value, it will use the border_radius value. 
border_top_right_radius (int) -- (optional) used for setting the value of top right border. If you don't set this value, it will use the border_radius value. 
border_bottom_left_radius (int) -- (optional) used for setting the value of bottom left border. If you don't set this value, it will use the border_radius value. 
border_bottom_right_radius (int) -- (optional) used for setting the value of bottom right border. If you don't set this value, it will use the border_radius value.  
 if border_radius < 1 it will draw rectangle without rounded corners if any of border radii has the value < 0 it will use value of the border_radius If sum of radii on the same side of the rectangle is greater than the rect size the radii will get scaled  
     
Returns:

a rect bounding the changed pixels, if nothing is drawn the bounding rect's position will be the position of the given rect parameter and its width and height will be 0   
Return type:

Rect      Note The pygame.Surface.fill() method works just as well for drawing filled rectangles and can be hardware accelerated on some platforms with both software and hardware display modes.   Changed in pygame 2.0.0: Added support for keyword arguments.   Changed in pygame 2.0.0.dev8: Added support for border radius.
pygame.encode_file_path() 
 Encode a Unicode or bytes object as a file system path encode_file_path([obj [, etype]]) -> bytes or None  obj: If Unicode, encode; if bytes, return unaltered; if anything else, return None; if not given, raise SyntaxError. etype (exception type): If given, the exception type to raise for an encoding error. The default is UnicodeEncodeError, as returned by PyUnicode_AsEncodedString(). This function is used to encode file paths in pygame. Encoding is to the codec as returned by sys.getfilesystemencoding(). Keyword arguments are supported.  New in pygame 1.9.2: (primarily for use in unit tests)
pygame.encode_string() 
 Encode a Unicode or bytes object encode_string([obj [, encoding [, errors [, etype]]]]) -> bytes or None  obj: If Unicode, encode; if bytes, return unaltered; if anything else, return None; if not given, raise SyntaxError. encoding (string): If present, encoding to use. The default is 'unicode_escape'. errors (string): If given, how to handle unencodable characters. The default is 'backslashreplace'. etype (exception type): If given, the exception type to raise for an encoding error. The default is UnicodeEncodeError, as returned by PyUnicode_AsEncodedString(). For the default encoding and errors values there should be no encoding errors. This function is used in encoding file paths. Keyword arguments are supported.  New in pygame 1.9.2: (primarily for use in unit tests)
exception pygame.error 
 standard pygame exception raise pygame.error(message)  This exception is raised whenever a pygame or SDL operation fails. You can catch any anticipated problems and deal with the error. The exception is always raised with a descriptive message about the problem. Derived from the RuntimeError exception, which can also be used to catch these raised errors.
pygame.event.clear() 
 remove all events from the queue clear(eventtype=None) -> None clear(eventtype=None, pump=True) -> None  Removes all events from the queue. If eventtype is given, removes the given event or sequence of events. This has the same effect as pygame.event.get() except None is returned. It can be slightly more efficient when clearing a full event queue. If pump is True (the default), then pygame.event.pump() will be called.  Changed in pygame 1.9.5: Added pump argument
pygame.event.custom_type() 
 make custom user event type custom_type() -> int  Reserves a pygame.USEREVENT for a custom use. If too many events are made a pygame.error is raised.  New in pygame 2.0.0.dev3.
pygame.event.Event() 
 create a new event object Event(type, dict) -> EventType instance Event(type, **attributes) -> EventType instance  Creates a new event with the given type and attributes. The attributes can come from a dictionary argument with string keys or from keyword arguments.
pygame.event.event_name() 
 get the string name from an event id event_name(type) -> string  Returns a string representing the name (in CapWords style) of the given event type. "UserEvent" is returned for all values in the user event id range. "Unknown" is returned when the event type does not exist.
pygame.event.EventType 
 pygame object for representing events  A pygame object that represents an event. User event instances are created with an pygame.event.Event() function call. The EventType type is not directly callable. EventType instances support attribute assignment and deletion.   type 
 event type identifier. type -> int  Read-only. The event type identifier. For user created event objects, this is the type argument passed to pygame.event.Event(). For example, some predefined event identifiers are QUIT and MOUSEMOTION. 
   __dict__ 
 event attribute dictionary __dict__ -> dict  Read-only. The event type specific attributes of an event. The dict attribute is a synonym for backward compatibility. For example, the attributes of a KEYDOWN event would be unicode, key, and mod 
  New in pygame 1.9.2: Mutable attributes.
__dict__ 
 event attribute dictionary __dict__ -> dict  Read-only. The event type specific attributes of an event. The dict attribute is a synonym for backward compatibility. For example, the attributes of a KEYDOWN event would be unicode, key, and mod
type 
 event type identifier. type -> int  Read-only. The event type identifier. For user created event objects, this is the type argument passed to pygame.event.Event(). For example, some predefined event identifiers are QUIT and MOUSEMOTION.
pygame.event.get() 
 get events from the queue get(eventtype=None) -> Eventlist get(eventtype=None, pump=True) -> Eventlist  This will get all the messages and remove them from the queue. If a type or sequence of types is given only those messages will be removed from the queue. If you are only taking specific events from the queue, be aware that the queue could eventually fill up with the events you are not interested. If pump is True (the default), then pygame.event.pump() will be called.  Changed in pygame 1.9.5: Added pump argument
pygame.event.get_blocked() 
 test if a type of event is blocked from the queue get_blocked(type) -> bool get_blocked(typelist) -> bool  Returns True if the given event type is blocked from the queue. If a sequence of event types is passed, this will return True if any of those event types are blocked.
pygame.event.get_grab() 
 test if the program is sharing input devices get_grab() -> bool  Returns True when the input events are grabbed for this application.
pygame.event.peek() 
 test if event types are waiting on the queue peek(eventtype=None) -> bool peek(eventtype=None, pump=True) -> bool  Returns True if there are any events of the given type waiting on the queue. If a sequence of event types is passed, this will return True if any of those events are on the queue. If pump is True (the default), then pygame.event.pump() will be called.  Changed in pygame 1.9.5: Added pump argument
pygame.event.poll() 
 get a single event from the queue poll() -> EventType instance  Returns a single event from the queue. If the event queue is empty an event of type pygame.NOEVENT will be returned immediately. The returned event is removed from the queue.  Caution This function should only be called in the thread that initialized pygame.display.
pygame.event.post() 
 place a new event on the queue post(Event) -> None  Places the given event at the end of the event queue. This is usually used for placing pygame.USEREVENT events on the queue. Although any type of event can be placed, if using the system event types your program should be sure to create the standard attributes with appropriate values. If the event queue is full a pygame.error is raised. Caution: In pygame 2.0, calling this function with event types defined by pygame (such as pygame.KEYDOWN) may put events into the SDL2 event queue. In this case, an error may be raised if standard attributes of that event are missing or have incompatible values, and unexpected properties may be silently omitted. In order to avoid this behaviour, custom event properties should be used with custom event types. This behaviour is not guaranteed.
pygame.event.pump() 
 internally process pygame event handlers pump() -> None  For each frame of your game, you will need to make some sort of call to the event queue. This ensures your program can internally interact with the rest of the operating system. If you are not using other event functions in your game, you should call pygame.event.pump() to allow pygame to handle internal actions. This function is not necessary if your program is consistently processing events on the queue through the other pygame.event functions. There are important things that must be dealt with internally in the event queue. The main window may need to be repainted or respond to the system. If you fail to make a call to the event queue for too long, the system may decide your program has locked up.  Caution This function should only be called in the thread that initialized pygame.display.
pygame.event.set_allowed() 
 control which events are allowed on the queue set_allowed(type) -> None set_allowed(typelist) -> None set_allowed(None) -> None  The given event types are allowed to appear on the event queue. By default, all event types can be placed on the queue. It is safe to enable an event type multiple times. If None is passed as the argument, ALL of the event types are allowed to be placed on the queue.
pygame.event.set_blocked() 
 control which events are allowed on the queue set_blocked(type) -> None set_blocked(typelist) -> None set_blocked(None) -> None  The given event types are not allowed to appear on the event queue. By default all events can be placed on the queue. It is safe to disable an event type multiple times. If None is passed as the argument, ALL of the event types are blocked from being placed on the queue.
pygame.event.set_grab() 
 control the sharing of input devices with other applications set_grab(bool) -> None  When your program runs in a windowed environment, it will share the mouse and keyboard devices with other applications that have focus. If your program sets the event grab to True, it will lock all input into your program. It is best to not always grab the input, since it prevents the user from doing other things on their system.
pygame.event.wait() 
 wait for a single event from the queue wait() -> EventType instance wait(timeout) -> EventType instance  Returns a single event from the queue. If the queue is empty this function will wait until one is created. From pygame 2.0.0, if a timeout argument is given, the function will return an event of type pygame.NOEVENT if no events enter the queue in timeout milliseconds. The event is removed from the queue once it has been returned. While the program is waiting it will sleep in an idle state. This is important for programs that want to share the system with other applications.  Changed in pygame 2.0.0.dev13: Added timeout argument   Caution This function should only be called in the thread that initialized pygame.display.
aliens.main() 
 play the full aliens example aliens.main() -> None  This started off as a port of the SDL demonstration, Aliens. Now it has evolved into something sort of resembling fun. This demonstrates a lot of different uses of sprites and optimized blitting. Also transparency, colorkeys, fonts, sound, music, joystick, and more. (PS, my high score is 117! goodluck)
arraydemo.main() 
 show various surfarray effects arraydemo.main(arraytype=None) -> None  Another example filled with various surfarray effects. It requires the surfarray and image modules to be installed. This little demo can also make a good starting point for any of your own tests with surfarray The arraytype parameter is deprecated; passing any value besides 'numpy' will raise ValueError.