neulab/docprompting-conala huggingface dataset:
get_sprites_from_layer() 
 returns all sprites from a layer, ordered by how they where added get_sprites_from_layer(layer) -> sprites  Returns all sprites from a layer, ordered by how they where added. It uses linear search and the sprites are not removed from layer.
get_top_layer() 
 returns the top layer get_top_layer() -> layer
get_top_sprite() 
 returns the topmost sprite get_top_sprite() -> Sprite
layers() 
 returns a list of layers defined (unique), sorted from bottom up. layers() -> layers
move_to_back() 
 moves the sprite to the bottom layer move_to_back(sprite) -> None  Moves the sprite to the bottom layer, moving it behind all other layers and adding one additional layer.
move_to_front() 
 brings the sprite to front layer move_to_front(sprite) -> None  Brings the sprite to front, changing sprite layer to topmost layer (added at the end of that layer).
remove_sprites_of_layer() 
 removes all sprites from a layer and returns them as a list. remove_sprites_of_layer(layer_nr) -> sprites
sprites() 
 returns a ordered list of sprites (first back, last top). sprites() -> sprites
switch_layer() 
 switches the sprites from layer1 to layer2 switch_layer(layer1_nr, layer2_nr) -> None  The layers number must exist, it is not checked.
pygame.sprite.OrderedUpdates() 
 RenderUpdates sub-class that draws Sprites in order of addition. OrderedUpdates(*spites) -> OrderedUpdates  This class derives from pygame.sprite.RenderUpdates(). It maintains the order in which the Sprites were added to the Group for rendering. This makes adding and removing Sprites from the Group a little slower than regular Groups.
pygame.sprite.RenderClear 
 Same as pygame.sprite.Group  This class is an alias to pygame.sprite.Group(). It has no additional functionality.
pygame.sprite.RenderPlain 
 Same as pygame.sprite.Group  This class is an alias to pygame.sprite.Group(). It has no additional functionality.
pygame.sprite.RenderUpdates 
 Group sub-class that tracks dirty updates. RenderUpdates(*sprites) -> RenderUpdates  This class is derived from pygame.sprite.Group(). It has an extended draw() method that tracks the changed areas of the screen.   draw() 
 blit the Sprite images and track changed areas draw(surface) -> Rect_list  Draws all the Sprites to the surface, the same as Group.draw(). This method also returns a list of Rectangular areas on the screen that have been changed. The returned changes include areas of the screen that have been affected by previous Group.clear() calls. The returned Rect list should be passed to pygame.display.update(). This will help performance on software driven display modes. This type of updating is usually only helpful on destinations with non-animating backgrounds.
draw() 
 blit the Sprite images and track changed areas draw(surface) -> Rect_list  Draws all the Sprites to the surface, the same as Group.draw(). This method also returns a list of Rectangular areas on the screen that have been changed. The returned changes include areas of the screen that have been affected by previous Group.clear() calls. The returned Rect list should be passed to pygame.display.update(). This will help performance on software driven display modes. This type of updating is usually only helpful on destinations with non-animating backgrounds.
pygame.sprite.Sprite 
 Simple base class for visible game objects. Sprite(*groups) -> Sprite  The base class for visible game objects. Derived classes will want to override the Sprite.update() and assign a Sprite.image and Sprite.rect attributes. The initializer can accept any number of Group instances to be added to. When subclassing the Sprite, be sure to call the base initializer before adding the Sprite to Groups. For example: 
class Block(pygame.sprite.Sprite):

    # Constructor. Pass in the color of the block,
    # and its x and y position
    def __init__(self, color, width, height):
       # Call the parent class (Sprite) constructor
       pygame.sprite.Sprite.__init__(self)

       # Create an image of the block, and fill it with a color.
       # This could also be an image loaded from the disk.
       self.image = pygame.Surface([width, height])
       self.image.fill(color)

       # Fetch the rectangle object that has the dimensions of the image
       # Update the position of this object by setting the values of rect.x and rect.y
       self.rect = self.image.get_rect()
    update() 
 method to control sprite behavior update(*args, **kwargs) -> None  The default implementation of this method does nothing; it's just a convenient "hook" that you can override. This method is called by Group.update() with whatever arguments you give it. There is no need to use this method if not using the convenience method by the same name in the Group class. 
   add() 
 add the sprite to groups add(*groups) -> None  Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of. 
   remove() 
 remove the sprite from groups remove(*groups) -> None  Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of. 
   kill() 
 remove the Sprite from all Groups kill() -> None  The Sprite is removed from all the Groups that contain it. This won't change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups. 
   alive() 
 does the sprite belong to any groups alive() -> bool  Returns True when the Sprite belongs to one or more Groups. 
   groups() 
 list of Groups that contain this Sprite groups() -> group_list  Return a list of all the Groups that contain this Sprite.
add() 
 add the sprite to groups add(*groups) -> None  Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of.
alive() 
 does the sprite belong to any groups alive() -> bool  Returns True when the Sprite belongs to one or more Groups.
groups() 
 list of Groups that contain this Sprite groups() -> group_list  Return a list of all the Groups that contain this Sprite.
kill() 
 remove the Sprite from all Groups kill() -> None  The Sprite is removed from all the Groups that contain it. This won't change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups.
remove() 
 remove the sprite from groups remove(*groups) -> None  Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of.
update() 
 method to control sprite behavior update(*args, **kwargs) -> None  The default implementation of this method does nothing; it's just a convenient "hook" that you can override. This method is called by Group.update() with whatever arguments you give it. There is no need to use this method if not using the convenience method by the same name in the Group class.
pygame.sprite.spritecollide() 
 Find sprites in a group that intersect another sprite. spritecollide(sprite, group, dokill, collided = None) -> Sprite_list  Return a list containing all Sprites in a Group that intersect with another Sprite. Intersection is determined by comparing the Sprite.rect attribute of each Sprite. The dokill argument is a bool. If set to True, all Sprites that collide will be removed from the Group. The collided argument is a callback function used to calculate if two sprites are colliding. it should take two sprites as values, and return a bool value indicating if they are colliding. If collided is not passed, all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision. collided callables: collide_rect, collide_rect_ratio, collide_circle,
collide_circle_ratio, collide_mask Example: 
# See if the Sprite block has collided with anything in the Group block_list
# The True flag will remove the sprite in block_list
blocks_hit_list = pygame.sprite.spritecollide(player, block_list, True)

# Check the list of colliding sprites, and add one to the score for each one
for block in blocks_hit_list:
    score +=1
pygame.sprite.spritecollideany() 
 Simple test if a sprite intersects anything in a group. 
spritecollideany(sprite, group, collided = None) -> Sprite Collision with the returned sprite. 
spritecollideany(sprite, group, collided = None) -> None No collision  If the sprite collides with any single sprite in the group, a single sprite from the group is returned. On no collision None is returned. If you don't need all the features of the pygame.sprite.spritecollide() function, this function will be a bit quicker. The collided argument is a callback function used to calculate if two sprites are colliding. It should take two sprites as values and return a bool value indicating if they are colliding. If collided is not passed, then all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision.
_pixels_address 
 pixel buffer address _pixels_address -> int  The starting address of the surface's raw pixel bytes.  New in pygame 1.9.2.
blit() 
 draw one image onto another blit(source, dest, area=None, special_flags=0) -> Rect  Draws a source Surface onto this Surface. The draw can be positioned with the dest argument. The dest argument can either be a pair of coordinates representing the position of the upper left corner of the blit or a Rect, where the upper left corner of the rectangle will be used as the position for the blit. The size of the destination rectangle does not effect the blit. An optional area rectangle can be passed as well. This represents a smaller portion of the source Surface to draw.  New in pygame 1.8: Optional special_flags: BLEND_ADD, BLEND_SUB, BLEND_MULT, BLEND_MIN, BLEND_MAX.   New in pygame 1.8.1: Optional special_flags: BLEND_RGBA_ADD, BLEND_RGBA_SUB, BLEND_RGBA_MULT, BLEND_RGBA_MIN, BLEND_RGBA_MAX BLEND_RGB_ADD, BLEND_RGB_SUB, BLEND_RGB_MULT, BLEND_RGB_MIN, BLEND_RGB_MAX.   New in pygame 1.9.2: Optional special_flags: BLEND_PREMULTIPLIED   New in pygame 2.0.0: Optional special_flags: BLEND_ALPHA_SDL2 - Uses the SDL2 blitter for alpha blending, this gives different results than the default blitter, which is modelled after SDL1, due to different approximations used for the alpha blending formula. The SDL2 blitter also supports RLE on alpha blended surfaces which the pygame one does not.  The return rectangle is the area of the affected pixels, excluding any pixels outside the destination Surface, or outside the clipping area. Pixel alphas will be ignored when blitting to an 8 bit Surface. For a surface with colorkey or blanket alpha, a blit to self may give slightly different colors than a non self-blit.
blits() 
 draw many images onto another blits(blit_sequence=(source, dest), ...), doreturn=1) -> [Rect, ...] or None blits((source, dest, area), ...)) -> [Rect, ...] blits((source, dest, area, special_flags), ...)) -> [Rect, ...]  Draws many surfaces onto this Surface. It takes a sequence as input, with each of the elements corresponding to the ones of blit(). It needs at minimum a sequence of (source, dest).     
Parameters:

 
blit_sequence -- a sequence of surfaces and arguments to blit them, they correspond to the blit() arguments 
doreturn -- if True, return a list of rects of the areas changed, otherwise return None
    
Returns:

a list of rects of the areas changed if doreturn is True, otherwise None   
Return type:

list or None     New in pygame 1.9.4.
convert() 
 change the pixel format of an image convert(Surface=None) -> Surface convert(depth, flags=0) -> Surface convert(masks, flags=0) -> Surface  Creates a new copy of the Surface with the pixel format changed. The new pixel format can be determined from another existing Surface. Otherwise depth, flags, and masks arguments can be used, similar to the pygame.Surface() call. If no arguments are passed the new Surface will have the same pixel format as the display Surface. This is always the fastest format for blitting. It is a good idea to convert all Surfaces before they are blitted many times. The converted Surface will have no pixel alphas. They will be stripped if the original had them. See convert_alpha() for preserving or creating per-pixel alphas. The new copy will have the same class as the copied surface. This lets as Surface subclass inherit this method without the need to override, unless subclass specific instance attributes also need copying.
convert_alpha() 
 change the pixel format of an image including per pixel alphas convert_alpha(Surface) -> Surface convert_alpha() -> Surface  Creates a new copy of the surface with the desired pixel format. The new surface will be in a format suited for quick blitting to the given format with per pixel alpha. If no surface is given, the new surface will be optimized for blitting to the current display. Unlike the convert() method, the pixel format for the new image will not be exactly the same as the requested source, but it will be optimized for fast alpha blitting to the destination. As with convert() the returned surface has the same class as the converted surface.
copy() 
 create a new copy of a Surface copy() -> Surface  Makes a duplicate copy of a Surface. The new surface will have the same pixel formats, color palettes, transparency settings, and class as the original. If a Surface subclass also needs to copy any instance specific attributes then it should override copy().
fill() 
 fill Surface with a solid color fill(color, rect=None, special_flags=0) -> Rect  Fill the Surface with a solid color. If no rect argument is given the entire Surface will be filled. The rect argument will limit the fill to a specific area. The fill will also be contained by the Surface clip area. The color argument can be either a RGB sequence, a RGBA sequence or a mapped color index. If using RGBA, the Alpha (A part of RGBA) is ignored unless the surface uses per pixel alpha (Surface has the SRCALPHA flag).  New in pygame 1.8: Optional special_flags: BLEND_ADD, BLEND_SUB, BLEND_MULT, BLEND_MIN, BLEND_MAX.   New in pygame 1.8.1: Optional special_flags: BLEND_RGBA_ADD, BLEND_RGBA_SUB, BLEND_RGBA_MULT, BLEND_RGBA_MIN, BLEND_RGBA_MAX BLEND_RGB_ADD, BLEND_RGB_SUB, BLEND_RGB_MULT, BLEND_RGB_MIN, BLEND_RGB_MAX.  This will return the affected Surface area.
get_abs_offset() 
 find the absolute position of a child subsurface inside its top level parent get_abs_offset() -> (x, y)  Get the offset position of a child subsurface inside of its top level parent Surface. If the Surface is not a subsurface this will return (0, 0).
get_abs_parent() 
 find the top level parent of a subsurface get_abs_parent() -> Surface  Returns the parent Surface of a subsurface. If this is not a subsurface then this surface will be returned.
get_alpha() 
 get the current Surface transparency value get_alpha() -> int_value  Return the current alpha value for the Surface.
get_at() 
 get the color value at a single pixel get_at((x, y)) -> Color  Return a copy of the RGBA Color value at the given pixel. If the Surface has no per pixel alpha, then the alpha value will always be 255 (opaque). If the pixel position is outside the area of the Surface an IndexError exception will be raised. Getting and setting pixels one at a time is generally too slow to be used in a game or realtime situation. It is better to use methods which operate on many pixels at a time like with the blit, fill and draw methods - or by using pygame.surfarray/pygame.PixelArray. This function will temporarily lock and unlock the Surface as needed.  New in pygame 1.9: Returning a Color instead of tuple. Use tuple(surf.get_at((x,y))) if you want a tuple, and not a Color. This should only matter if you want to use the color as a key in a dict.
get_at_mapped() 
 get the mapped color value at a single pixel get_at_mapped((x, y)) -> Color  Return the integer value of the given pixel. If the pixel position is outside the area of the Surface an IndexError exception will be raised. This method is intended for pygame unit testing. It unlikely has any use in an application. This function will temporarily lock and unlock the Surface as needed.  New in pygame 1.9.2.
get_bitsize() 
 get the bit depth of the Surface pixel format get_bitsize() -> int  Returns the number of bits used to represent each pixel. This value may not exactly fill the number of bytes used per pixel. For example a 15 bit Surface still requires a full 2 bytes.
get_bounding_rect() 
 find the smallest rect containing data get_bounding_rect(min_alpha = 1) -> Rect  Returns the smallest rectangular region that contains all the pixels in the surface that have an alpha value greater than or equal to the minimum alpha value. This function will temporarily lock and unlock the Surface as needed.  New in pygame 1.8.
get_buffer() 
 acquires a buffer object for the pixels of the Surface. get_buffer() -> BufferProxy  Return a buffer object for the pixels of the Surface. The buffer can be used for direct pixel access and manipulation. Surface pixel data is represented as an unstructured block of memory, with a start address and length in bytes. The data need not be contiguous. Any gaps are included in the length, but otherwise ignored. This method implicitly locks the Surface. The lock will be released when the returned pygame.BufferProxy object is garbage collected.  New in pygame 1.8.
get_bytesize() 
 get the bytes used per Surface pixel get_bytesize() -> int  Return the number of bytes used per pixel.
get_clip() 
 get the current clipping area of the Surface get_clip() -> Rect  Return a rectangle of the current clipping area. The Surface will always return a valid rectangle that will never be outside the bounds of the image. If the Surface has had None set for the clipping area, the Surface will return a rectangle with the full area of the Surface.
get_colorkey() 
 Get the current transparent colorkey get_colorkey() -> RGB or None  Return the current colorkey value for the Surface. If the colorkey is not set then None is returned.
get_flags() 
 get the additional flags used for the Surface get_flags() -> int  Returns a set of current Surface features. Each feature is a bit in the flags bitmask. Typical flags are HWSURFACE, RLEACCEL, SRCALPHA, and SRCCOLORKEY. Here is a more complete list of flags. A full list can be found in SDL_video.h SWSURFACE      0x00000000    # Surface is in system memory
HWSURFACE      0x00000001    # Surface is in video memory
ASYNCBLIT      0x00000004    # Use asynchronous blits if possible Available for pygame.display.set_mode() ANYFORMAT      0x10000000    # Allow any video depth/pixel-format
HWPALETTE      0x20000000    # Surface has exclusive palette
DOUBLEBUF      0x40000000    # Set up double-buffered video mode
FULLSCREEN     0x80000000    # Surface is a full screen display
OPENGL         0x00000002    # Create an OpenGL rendering context
OPENGLBLIT     0x0000000A    # OBSOLETE. Create an OpenGL rendering context and use it for blitting.
RESIZABLE      0x00000010    # This video mode may be resized
NOFRAME        0x00000020    # No window caption or edge frame Used internally (read-only) HWACCEL        0x00000100    # Blit uses hardware acceleration
SRCCOLORKEY    0x00001000    # Blit uses a source color key
RLEACCELOK     0x00002000    # Private flag
RLEACCEL       0x00004000    # Surface is RLE encoded
SRCALPHA       0x00010000    # Blit uses source alpha blending
PREALLOC       0x01000000    # Surface uses preallocated memory
get_height() 
 get the height of the Surface get_height() -> height  Return the height of the Surface in pixels.
get_locked() 
 test if the Surface is current locked get_locked() -> bool  Returns True when the Surface is locked. It doesn't matter how many times the Surface is locked.
get_locks() 
 Gets the locks for the Surface get_locks() -> tuple  Returns the currently existing locks for the Surface.
get_losses() 
 the significant bits used to convert between a color and a mapped integer get_losses() -> (R, G, B, A)  Return the least significant number of bits stripped from each color in a mapped integer. This value is not needed for normal pygame usage.
get_masks() 
 the bitmasks needed to convert between a color and a mapped integer get_masks() -> (R, G, B, A)  Returns the bitmasks used to isolate each color in a mapped integer. This value is not needed for normal pygame usage.
get_offset() 
 find the position of a child subsurface inside a parent get_offset() -> (x, y)  Get the offset position of a child subsurface inside of a parent. If the Surface is not a subsurface this will return (0, 0).
get_palette() 
 get the color index palette for an 8-bit Surface get_palette() -> [RGB, RGB, RGB, ...]  Return a list of up to 256 color elements that represent the indexed colors used in an 8-bit Surface. The returned list is a copy of the palette, and changes will have no effect on the Surface. Returning a list of Color(with length 3) instances instead of tuples.  New in pygame 1.9.
get_palette_at() 
 get the color for a single entry in a palette get_palette_at(index) -> RGB  Returns the red, green, and blue color values for a single index in a Surface palette. The index should be a value from 0 to 255.  New in pygame 1.9: Returning Color(with length 3) instance instead of a tuple.
get_parent() 
 find the parent of a subsurface get_parent() -> Surface  Returns the parent Surface of a subsurface. If this is not a subsurface then None will be returned.
get_pitch() 
 get the number of bytes used per Surface row get_pitch() -> int  Return the number of bytes separating each row in the Surface. Surfaces in video memory are not always linearly packed. Subsurfaces will also have a larger pitch than their real width. This value is not needed for normal pygame usage.
get_rect() 
 get the rectangular area of the Surface get_rect(**kwargs) -> Rect  Returns a new rectangle covering the entire surface. This rectangle will always start at (0, 0) with a width and height the same size as the image. You can pass keyword argument values to this function. These named values will be applied to the attributes of the Rect before it is returned. An example would be mysurf.get_rect(center=(100, 100)) to create a rectangle for the Surface centered at a given position.
get_shifts() 
 the bit shifts needed to convert between a color and a mapped integer get_shifts() -> (R, G, B, A)  Returns the pixel shifts need to convert between each color and a mapped integer. This value is not needed for normal pygame usage.
get_size() 
 get the dimensions of the Surface get_size() -> (width, height)  Return the width and height of the Surface in pixels.