neulab/docprompting-conala huggingface dataset:
pygame.gfxdraw.aapolygon() 
 draw an antialiased polygon aapolygon(surface, points, color) -> None  Draws an unfilled antialiased polygon on the given surface. The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For the points [(x1, y1), (x2, y2), (x3, y3)] a line segment will be drawn from (x1, y1) to (x2, y2), from (x2, y2) to (x3, y3), and from (x3, y3) to (x1, y1).     
Parameters:

 
surface (Surface) -- surface to draw on 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats (float values will be truncated) 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType   
Raises:

 
ValueError -- if len(points) < 3 (must have at least 3 points) 
IndexError -- if len(coordinate) < 2 (each coordinate must have at least 2 items)
pygame.gfxdraw.aatrigon() 
 draw an antialiased trigon/triangle aatrigon(surface, x1, y1, x2, y2, x3, y3, color) -> None  Draws an unfilled antialiased trigon (triangle) on the given surface. An aatrigon can also be drawn using aapolygon() e.g. aapolygon(surface, ((x1, y1), (x2, y2), (x3, y3)), color)     
Parameters:

 
surface (Surface) -- surface to draw on 
x1 (int) -- x coordinate of the first corner of the trigon 
y1 (int) -- y coordinate of the first corner of the trigon 
x2 (int) -- x coordinate of the second corner of the trigon 
y2 (int) -- y coordinate of the second corner of the trigon 
x3 (int) -- x coordinate of the third corner of the trigon 
y3 (int) -- y coordinate of the third corner of the trigon 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.arc() 
 draw an arc arc(surface, x, y, r, start_angle, stop_angle, color) -> None  Draws an arc on the given surface. For an arc with its endpoints connected to its center use pie(). The two angle arguments are given in degrees and indicate the start and stop positions of the arc. The arc is drawn in a clockwise direction from the start_angle to the stop_angle. If start_angle == stop_angle, nothing will be drawn     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the arc 
y (int) -- y coordinate of the center of the arc 
r (int) -- radius of the arc 
start_angle (int) -- start angle in degrees 
stop_angle (int) -- stop angle in degrees 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType      Note This function uses degrees while the pygame.draw.arc() function uses radians.
pygame.gfxdraw.bezier() 
 draw a Bezier curve bezier(surface, points, steps, color) -> None  Draws a Bézier curve on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates used to form a curve, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats (float values will be truncated) 
steps (int) -- number of steps for the interpolation, the minimum is 2 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType   
Raises:

 
ValueError -- if steps < 2
 
ValueError -- if len(points) < 3 (must have at least 3 points) 
IndexError -- if len(coordinate) < 2 (each coordinate must have at least 2 items)
pygame.gfxdraw.box() 
 draw a filled rectangle box(surface, rect, color) -> None  Draws a filled rectangle on the given surface. For an unfilled rectangle use rectangle().     
Parameters:

 
surface (Surface) -- surface to draw on 
rect (Rect) -- rectangle to draw, position and dimensions 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType      Note The rect.bottom and rect.right attributes of a pygame.Rect always lie one pixel outside of its actual border. Therefore, these values will not be included as part of the drawing.   Note The pygame.Surface.fill() method works just as well for drawing filled rectangles. In fact pygame.Surface.fill() can be hardware accelerated on some platforms with both software and hardware display modes.
pygame.gfxdraw.circle() 
 draw a circle circle(surface, x, y, r, color) -> None  Draws an unfilled circle on the given surface. For a filled circle use filled_circle().     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the circle 
y (int) -- y coordinate of the center of the circle 
r (int) -- radius of the circle 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.ellipse() 
 draw an ellipse ellipse(surface, x, y, rx, ry, color) -> None  Draws an unfilled ellipse on the given surface. For a filled ellipse use filled_ellipse().     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the ellipse 
y (int) -- y coordinate of the center of the ellipse 
rx (int) -- horizontal radius of the ellipse 
ry (int) -- vertical radius of the ellipse 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.filled_circle() 
 draw a filled circle filled_circle(surface, x, y, r, color) -> None  Draws a filled circle on the given surface. For an unfilled circle use circle().     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the circle 
y (int) -- y coordinate of the center of the circle 
r (int) -- radius of the circle 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.filled_ellipse() 
 draw a filled ellipse filled_ellipse(surface, x, y, rx, ry, color) -> None  Draws a filled ellipse on the given surface. For an unfilled ellipse use ellipse().     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the ellipse 
y (int) -- y coordinate of the center of the ellipse 
rx (int) -- horizontal radius of the ellipse 
ry (int) -- vertical radius of the ellipse 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.filled_polygon() 
 draw a filled polygon filled_polygon(surface, points, color) -> None  Draws a filled polygon on the given surface. For an unfilled polygon use polygon(). The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For the points [(x1, y1), (x2, y2), (x3, y3)] a line segment will be drawn from (x1, y1) to (x2, y2), from (x2, y2) to (x3, y3), and from (x3, y3) to (x1, y1).     
Parameters:

 
surface (Surface) -- surface to draw on 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats (float values will be truncated)` 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType   
Raises:

 
ValueError -- if len(points) < 3 (must have at least 3 points) 
IndexError -- if len(coordinate) < 2 (each coordinate must have at least 2 items)
pygame.gfxdraw.filled_trigon() 
 draw a filled trigon/triangle filled_trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None  Draws a filled trigon (triangle) on the given surface. For an unfilled trigon use trigon(). A filled_trigon can also be drawn using filled_polygon() e.g. filled_polygon(surface, ((x1, y1), (x2, y2), (x3, y3)), color)     
Parameters:

 
surface (Surface) -- surface to draw on 
x1 (int) -- x coordinate of the first corner of the trigon 
y1 (int) -- y coordinate of the first corner of the trigon 
x2 (int) -- x coordinate of the second corner of the trigon 
y2 (int) -- y coordinate of the second corner of the trigon 
x3 (int) -- x coordinate of the third corner of the trigon 
y3 (int) -- y coordinate of the third corner of the trigon 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.hline() 
 draw a horizontal line hline(surface, x1, x2, y, color) -> None  Draws a straight horizontal line ((x1, y) to (x2, y)) on the given surface. There are no endcaps.     
Parameters:

 
surface (Surface) -- surface to draw on 
x1 (int) -- x coordinate of one end of the line 
x2 (int) -- x coordinate of the other end of the line 
y (int) -- y coordinate of the line 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.line() 
 draw a line line(surface, x1, y1, x2, y2, color) -> None  Draws a straight line ((x1, y1) to (x2, y2)) on the given surface. There are no endcaps.     
Parameters:

 
surface (Surface) -- surface to draw on 
x1 (int) -- x coordinate of one end of the line 
y1 (int) -- y coordinate of one end of the line 
x2 (int) -- x coordinate of the other end of the line 
y2 (int) -- y coordinate of the other end of the line 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.pie() 
 draw a pie pie(surface, x, y, r, start_angle, stop_angle, color) -> None  Draws an unfilled pie on the given surface. A pie is an arc() with its endpoints connected to its center. The two angle arguments are given in degrees and indicate the start and stop positions of the pie. The pie is drawn in a clockwise direction from the start_angle to the stop_angle. If start_angle == stop_angle, a straight line will be drawn from the center position at the given angle, to a length of the radius.     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the center of the pie 
y (int) -- y coordinate of the center of the pie 
r (int) -- radius of the pie 
start_angle (int) -- start angle in degrees 
stop_angle (int) -- stop angle in degrees 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.pixel() 
 draw a pixel pixel(surface, x, y, color) -> None  Draws a single pixel, at position (x ,y), on the given surface.     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the pixel 
y (int) -- y coordinate of the pixel 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.polygon() 
 draw a polygon polygon(surface, points, color) -> None  Draws an unfilled polygon on the given surface. For a filled polygon use filled_polygon(). The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For the points [(x1, y1), (x2, y2), (x3, y3)] a line segment will be drawn from (x1, y1) to (x2, y2), from (x2, y2) to (x3, y3), and from (x3, y3) to (x1, y1).     
Parameters:

 
surface (Surface) -- surface to draw on 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats (float values will be truncated) 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType   
Raises:

 
ValueError -- if len(points) < 3 (must have at least 3 points) 
IndexError -- if len(coordinate) < 2 (each coordinate must have at least 2 items)
pygame.gfxdraw.rectangle() 
 draw a rectangle rectangle(surface, rect, color) -> None  Draws an unfilled rectangle on the given surface. For a filled rectangle use box().     
Parameters:

 
surface (Surface) -- surface to draw on 
rect (Rect) -- rectangle to draw, position and dimensions 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType      Note The rect.bottom and rect.right attributes of a pygame.Rect always lie one pixel outside of its actual border. Therefore, these values will not be included as part of the drawing.
pygame.gfxdraw.textured_polygon() 
 draw a textured polygon textured_polygon(surface, points, texture, tx, ty) -> None  Draws a textured polygon on the given surface. For better performance, the surface and the texture should have the same format. A per-pixel alpha texture blit to a per-pixel alpha surface will differ from a pygame.Surface.blit() blit. Also, a per-pixel alpha texture cannot be used with an 8-bit per pixel destination. The adjacent coordinates in the points argument, as well as the first and last points, will be connected by line segments. e.g. For the points [(x1, y1), (x2, y2), (x3, y3)] a line segment will be drawn from (x1, y1) to (x2, y2), from (x2, y2) to (x3, y3), and from (x3, y3) to (x1, y1).     
Parameters:

 
surface (Surface) -- surface to draw on 
points (tuple(coordinate) or list(coordinate)) -- a sequence of 3 or more (x, y) coordinates, where each coordinate in the sequence must be a tuple/list/pygame.math.Vector2 of 2 ints/floats (float values will be truncated) 
texture (Surface) -- texture to draw on the polygon 
tx (int) -- x offset of the texture 
ty (int) -- y offset of the texture    
Returns:

None   
Return type:

NoneType   
Raises:

 
ValueError -- if len(points) < 3 (must have at least 3 points) 
IndexError -- if len(coordinate) < 2 (each coordinate must have at least 2 items)
pygame.gfxdraw.trigon() 
 draw a trigon/triangle trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None  Draws an unfilled trigon (triangle) on the given surface. For a filled trigon use filled_trigon(). A trigon can also be drawn using polygon() e.g. polygon(surface, ((x1, y1), (x2, y2), (x3, y3)), color)     
Parameters:

 
surface (Surface) -- surface to draw on 
x1 (int) -- x coordinate of the first corner of the trigon 
y1 (int) -- y coordinate of the first corner of the trigon 
x2 (int) -- x coordinate of the second corner of the trigon 
y2 (int) -- y coordinate of the second corner of the trigon 
x3 (int) -- x coordinate of the third corner of the trigon 
y3 (int) -- y coordinate of the third corner of the trigon 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.gfxdraw.vline() 
 draw a vertical line vline(surface, x, y1, y2, color) -> None  Draws a straight vertical line ((x, y1) to (x, y2)) on the given surface. There are no endcaps.     
Parameters:

 
surface (Surface) -- surface to draw on 
x (int) -- x coordinate of the line 
y1 (int) -- y coordinate of one end of the line 
y2 (int) -- y coordinate of the other end of the line 
color (Color or tuple(int, int, int, [int])) -- color to draw with, the alpha value is optional if using a tuple (RGB[A])
    
Returns:

None   
Return type:

NoneType
pygame.image.frombuffer() 
 create a new Surface that shares data inside a bytes buffer frombuffer(bytes, size, format) -> Surface  Create a new Surface that shares pixel data directly from a bytes buffer. This method takes similar arguments to pygame.image.fromstring(), but is unable to vertically flip the source data. This will run much faster than pygame.image.fromstring(), since no pixel data must be allocated and copied. It accepts the following 'format' arguments:  
 
P, 8-bit palettized Surfaces 
RGB, 24-bit image 
BGR, 24-bit image, red and blue channels swapped. 
RGBX, 32-bit image with unused space 
RGBA, 32-bit image with an alpha channel 
ARGB, 32-bit image with alpha channel first
pygame.image.fromstring() 
 create new Surface from a string buffer fromstring(string, size, format, flipped=False) -> Surface  This function takes arguments similar to pygame.image.tostring(). The size argument is a pair of numbers representing the width and height. Once the new Surface is created you can destroy the string buffer. The size and format image must compute the exact same size as the passed string buffer. Otherwise an exception will be raised. See the pygame.image.frombuffer() method for a potentially faster way to transfer images into pygame.
pygame.image.get_extended() 
 test if extended image formats can be loaded get_extended() -> bool  If pygame is built with extended image formats this function will return True. It is still not possible to determine which formats will be available, but generally you will be able to load them all.
pygame.image.get_sdl_image_version() 
 get version number of the SDL_Image library being used get_sdl_image_version() -> None get_sdl_image_version() -> (major, minor, patch)  If pygame is built with extended image formats, then this function will return the SDL_Image library's version number as a tuple of 3 integers (major, minor, patch). If not, then it will return None.  New in pygame 2.0.0.dev11.
pygame.image.load() 
 load new image from a file (or file-like object) load(filename) -> Surface load(fileobj, namehint="") -> Surface  Load an image from a file source. You can pass either a filename or a Python file-like object. Pygame will automatically determine the image type (e.g., GIF or bitmap) and create a new Surface object from the data. In some cases it will need to know the file extension (e.g., GIF images should end in ".gif"). If you pass a raw file-like object, you may also want to pass the original filename as the namehint argument. The returned Surface will contain the same color format, colorkey and alpha transparency as the file it came from. You will often want to call Surface.convert() with no arguments, to create a copy that will draw more quickly on the screen. For alpha transparency, like in .png images, use the convert_alpha() method after loading so that the image has per pixel transparency. pygame may not always be built to support all image formats. At minimum it will support uncompressed BMP. If pygame.image.get_extended() returns 'True', you should be able to load most images (including PNG, JPG and GIF). You should use os.path.join() for compatibility. eg. asurf = pygame.image.load(os.path.join('data', 'bla.png'))
pygame.image.load_basic() 
 load new BMP image from a file (or file-like object) load_basic(file) -> Surface  Load an image from a file source. You can pass either a filename or a Python file-like object. This function only supports loading "basic" image format, ie BMP format. This function is always available, no matter how pygame was built.
pygame.image.load_extended() 
 load an image from a file (or file-like object) load_extended(filename) -> Surface load_extended(fileobj, namehint="") -> Surface  This function is similar to pygame.image.load(), except that this function can only be used if pygame was built with extended image format support. From version 2.0.1, this function is always available, but raises an error if extended image formats are not supported. Previously, this function may or may not be available, depending on the state of extended image format support.  Changed in pygame 2.0.1.
pygame.image.save() 
 save an image to file (or file-like object) save(Surface, filename) -> None save(Surface, fileobj, namehint="") -> None  This will save your Surface as either a BMP, TGA, PNG, or JPEG image. If the filename extension is unrecognized it will default to TGA. Both TGA, and BMP file formats create uncompressed files. You can pass a filename or a Python file-like object. For file-like object, the image is saved to TGA format unless a namehint with a recognizable extension is passed in.  Note To be able to save the JPEG file format to a file-like object, SDL2_Image version 2.0.2 or newer is needed.   Note When saving to a file-like object, it seems that for most formats, the object needs to be flushed after saving to it to make loading from it possible.   Changed in pygame 1.8: Saving PNG and JPEG files.   Changed in pygame 2.0.0.dev11: The namehint parameter was added to make it possible to save other formats than TGA to a file-like object.
pygame.image.save_extended() 
 save a png/jpg image to file (or file-like object) save_extended(Surface, filename) -> None save_extended(Surface, fileobj, namehint="") -> None  This will save your Surface as either a PNG or JPEG image. Incase the image is being saved to a file-like object, this function uses the namehint argument to determine the format of the file being saved. Saves to JPEG incase the namehint was not specified while saving to file-like object. From version 2.0.1, this function is always available, but raises an error if extended image formats are not supported. Previously, this function may or may not be available, depending on the state of extended image format support.  Changed in pygame 2.0.1.
pygame.image.tostring() 
 transfer image to string buffer tostring(Surface, format, flipped=False) -> string  Creates a string that can be transferred with the 'fromstring' method in other Python imaging packages. Some Python image packages prefer their images in bottom-to-top format (PyOpenGL for example). If you pass True for the flipped argument, the string buffer will be vertically flipped. The format argument is a string of one of the following values. Note that only 8-bit Surfaces can use the "P" format. The other formats will work for any Surface. Also note that other Python image packages support more formats than pygame.  
 
P, 8-bit palettized Surfaces 
RGB, 24-bit image 
RGBX, 32-bit image with unused space 
RGBA, 32-bit image with an alpha channel 
ARGB, 32-bit image with alpha channel first 
RGBA_PREMULT, 32-bit image with colors scaled by alpha channel 
ARGB_PREMULT, 32-bit image with colors scaled by alpha channel, alpha channel first
pygame.init() 
 initialize all imported pygame modules init() -> (numpass, numfail)  Initialize all imported pygame modules. No exceptions will be raised if a module fails, but the total number if successful and failed inits will be returned as a tuple. You can always initialize individual modules manually, but pygame.init() is a convenient way to get everything started. The init() functions for individual modules will raise exceptions when they fail. You may want to initialize the different modules separately to speed up your program or to not use modules your game does not require. It is safe to call this init() more than once as repeated calls will have no effect. This is true even if you have pygame.quit() all the modules.
pygame.joystick.get_count() 
 Returns the number of joysticks. get_count() -> count  Return the number of joystick devices on the system. The count will be 0 if there are no joysticks on the system. When you create Joystick objects using Joystick(id), you pass an integer that must be lower than this count.
pygame.joystick.get_init() 
 Returns True if the joystick module is initialized. get_init() -> bool  Test if the pygame.joystick.init() function has been called.
pygame.joystick.init() 
 Initialize the joystick module. init() -> None  This function is called automatically by pygame.init(). It initializes the joystick module. The module must be initialized before any other functions will work. It is safe to call this function more than once.