neulab/docprompting-conala huggingface dataset:
move_ip() 
 moves the rectangle, in place move_ip(x, y) -> None  Same as the Rect.move() method, but operates in place.
normalize() 
 correct negative sizes normalize() -> None  This will flip the width or height of a rectangle if it has a negative size. The rectangle will remain in the same place, with only the sides swapped.
union() 
 joins two rectangles into one union(Rect) -> Rect  Returns a new rectangle that completely covers the area of the two provided rectangles. There may be area inside the new Rect that is not covered by the originals.
union_ip() 
 joins two rectangles into one, in place union_ip(Rect) -> None  Same as the Rect.union() method, but operates in place.
unionall() 
 the union of many rectangles unionall(Rect_sequence) -> Rect  Returns the union of one rectangle with a sequence of many rectangles.
unionall_ip() 
 the union of many rectangles, in place unionall_ip(Rect_sequence) -> None  The same as the Rect.unionall() method, but operates in place.
update() 
 sets the position and size of the rectangle update(left, top, width, height) -> None update((left, top), (width, height)) -> None update(object) -> None  Sets the position and size of the rectangle, in place. See parameters for pygame.Rect() for the parameters of this function.  New in pygame 2.0.1.
pygame.register_quit() 
 register a function to be called when pygame quits register_quit(callable) -> None  When pygame.quit() is called, all registered quit functions are called. Pygame modules do this automatically when they are initializing, so this function will rarely be needed.
pygame.scrap.contains() 
 Checks whether data for a given type is available in the clipboard. contains(type) -> bool  Checks whether data for the given type is currently available in the clipboard.     
Parameters:

type (string) -- data type to check availability of  
Returns:

True if data for the passed type is available in the clipboard, False otherwise  
Return type:
bool    if pygame.scrap.contains(pygame.SCRAP_TEXT):
    print("There is text in the clipboard.")
if pygame.scrap.contains("own_data_type"):
    print("There is stuff in the clipboard.")
pygame.scrap.get() 
 Gets the data for the specified type from the clipboard. get(type) -> bytes or str or None  Retrieves the data for the specified type from the clipboard. In python 3 the data is returned as a byte string and might need further processing (such as decoding to Unicode).     
Parameters:

type (string) -- data type to retrieve from the clipboard  
Returns:
data (byte string in python 3 or str in python 2) for the given type identifier or None if no data for the given type is available  
Return type:
bytes or str or None    text = pygame.scrap.get(pygame.SCRAP_TEXT)
if text:
    print("There is text in the clipboard.")
else:
    print("There does not seem to be text in the clipboard.")
pygame.scrap.get_init() 
 Returns True if the scrap module is currently initialized. get_init() -> bool  Gets the scrap module's initialization state.     
Returns:

True if the pygame.scrap module is currently initialized, False otherwise  
Return type:
bool     New in pygame 1.9.5.
pygame.scrap.get_types() 
 Gets a list of the available clipboard types. get_types() -> list  Gets a list of data type string identifiers for the data currently available on the clipboard. Each identifier can be used in the pygame.scrap.get() method to get the clipboard content of the specific type.     
Returns:
list of strings of the available clipboard data types, if there is no data in the clipboard an empty list is returned  
Return type:
list    for t in pygame.scrap.get_types():
    if "text" in t:
        # There is some content with the word "text" in its type string.
        print(pygame.scrap.get(t))
pygame.scrap.init() 
 Initializes the scrap module. init() -> None  Initialize the scrap module.     
Raises:

pygame.error -- if unable to initialize scrap module        Note The scrap module requires pygame.display.set_mode() be called before being initialized.
pygame.scrap.lost() 
 Indicates if the clipboard ownership has been lost by the pygame application. lost() -> bool  Indicates if the clipboard ownership has been lost by the pygame application.     
Returns:

True, if the clipboard ownership has been lost by the pygame application, False if the pygame application still owns the clipboard  
Return type:
bool    if pygame.scrap.lost():
    print("The clipboard is in use by another application.")
pygame.scrap.put() 
 Places data into the clipboard. put(type, data) -> None  Places data for a given clipboard type into the clipboard. The data must be a string buffer. The type is a string identifying the type of data to be placed into the clipboard. This can be one of the predefined pygame.SCRAP_PBM, pygame.SCRAP_PPM, pygame.SCRAP_BMP or pygame.SCRAP_TEXT values or a user defined string identifier.     
Parameters:

 
type (string) -- type identifier of the data to be placed into the clipboard 
data (bytes or str) -- data to be place into the clipboard (in python 3 data is a byte string and in python 2 data is a str)    
Raises:

pygame.error -- if unable to put the data into the clipboard     with open("example.bmp", "rb") as fp:
    pygame.scrap.put(pygame.SCRAP_BMP, fp.read())
# The image data is now on the clipboard for other applications to access
# it.
pygame.scrap.put(pygame.SCRAP_TEXT, b"A text to copy")
pygame.scrap.put("Plain text", b"Data for user defined type 'Plain text'")
pygame.scrap.set_mode() 
 Sets the clipboard access mode. set_mode(mode) -> None  Sets the access mode for the clipboard. This is only of interest for X11 environments where clipboard modes pygame.SCRAP_SELECTION (for mouse selections) and pygame.SCRAP_CLIPBOARD (for the clipboard) are available. Setting the mode to pygame.SCRAP_SELECTION in other environments will not change the mode from pygame.SCRAP_CLIPBOARD.     
Parameters:

mode -- access mode, supported values are pygame.SCRAP_CLIPBOARD and pygame.SCRAP_SELECTION (pygame.SCRAP_SELECTION only has an effect when used on X11 platforms)  
Raises:

ValueError -- if the mode parameter is not pygame.SCRAP_CLIPBOARD or pygame.SCRAP_SELECTION
pygame.set_error() 
 set the current error message set_error(error_msg) -> None  SDL maintains an internal error message. This message will usually be given to you when pygame.error() is raised, so this function will rarely be needed.
pygame.sndarray.array() 
 copy Sound samples into an array array(Sound) -> array  Creates a new array for the sound data and copies the samples. The array will always be in the format returned from pygame.mixer.get_init().
pygame.sndarray.get_arraytype() 
 Gets the currently active array type. get_arraytype () -> str  DEPRECATED: Returns the currently active array type. This will be a value of the get_arraytypes() tuple and indicates which type of array module is used for the array creation.  New in pygame 1.8.
pygame.sndarray.get_arraytypes() 
 Gets the array system types currently supported. get_arraytypes () -> tuple  DEPRECATED: Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the pygame.sndarray.use_arraytype() () method. If no supported array system could be found, None will be returned.  New in pygame 1.8.
pygame.sndarray.make_sound() 
 convert an array into a Sound object make_sound(array) -> Sound  Create a new playable Sound object from an array. The mixer module must be initialized and the array format must be similar to the mixer audio format.
pygame.sndarray.samples() 
 reference Sound samples into an array samples(Sound) -> array  Creates a new array that directly references the samples in a Sound object. Modifying the array will change the Sound. The array will always be in the format returned from pygame.mixer.get_init().
pygame.sndarray.use_arraytype() 
 Sets the array system to be used for sound arrays use_arraytype (arraytype) -> None  DEPRECATED: Uses the requested array type for the module functions. The only supported arraytype is 'numpy'. Other values will raise ValueError.
pygame.sprite.collide_circle() 
 Collision detection between two sprites, using circles. collide_circle(left, right) -> bool  Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to create the circle, otherwise a circle is created that is big enough to completely enclose the sprites rect as given by the "rect" attribute. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute.  New in pygame 1.8.1.
pygame.sprite.collide_circle_ratio() 
 Collision detection between two sprites, using circles scaled to a ratio. collide_circle_ratio(ratio) -> collided_callable  A callable class that checks for collisions between two sprites, using a scaled version of the sprites radius. Is created with a floating point ratio, the instance is then intended to be passed as a collided callback function to the *collide functions. A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as big, and 0.5 is half the size. The created callable tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap, after scaling the circles radius by the stored ratio. If the sprites have a "radius" attribute, that is used to create the circle, otherwise a circle is created that is big enough to completely enclose the sprites rect as given by the "rect" attribute. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute.  New in pygame 1.8.1.
pygame.sprite.collide_mask() 
 Collision detection between two sprites, using masks. collide_mask(sprite1, sprite2) -> (int, int) collide_mask(sprite1, sprite2) -> None  Tests for collision between two sprites, by testing if their bitmasks overlap (uses pygame.mask.Mask.overlap()). If the sprites have a mask attribute, it is used as the mask, otherwise a mask is created from the sprite's image (uses pygame.mask.from_surface()). Sprites must have a rect attribute; the mask attribute is optional. The first point of collision between the masks is returned. The collision point is offset from sprite1's mask's topleft corner (which is always (0, 0)). The collision point is a position within the mask and is not related to the actual screen position of sprite1. This function is intended to be passed as a collided callback function to the group collide functions (see spritecollide(), groupcollide(), spritecollideany()).  Note To increase performance, create and set a mask attibute for all sprites that will use this function to check for collisions. Otherwise, each time this function is called it will create new masks.   Note A new mask needs to be recreated each time a sprite's image is changed (e.g. if a new image is used or the existing image is rotated).  # Example of mask creation for a sprite.
sprite.mask = pygame.mask.from_surface(sprite.image)     
Returns:
first point of collision between the masks or None if no collision  
Return type:
tuple(int, int) or NoneType     New in pygame 1.8.0.
pygame.sprite.collide_rect() 
 Collision detection between two sprites, using rects. collide_rect(left, right) -> bool  Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" attributes.  New in pygame 1.8.
pygame.sprite.collide_rect_ratio() 
 Collision detection between two sprites, using rects scaled to a ratio. collide_rect_ratio(ratio) -> collided_callable  A callable class that checks for collisions between two sprites, using a scaled version of the sprites rects. Is created with a ratio, the instance is then intended to be passed as a collided callback function to the *collide functions. A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as big, and 0.5 is half the size.  New in pygame 1.8.1.
pygame.sprite.DirtySprite 
 A subclass of Sprite with more attributes and features. DirtySprite(*groups) -> DirtySprite  Extra DirtySprite attributes with their default values: dirty = 1 if set to 1, it is repainted and then set to 0 again
if set to 2 then it is always dirty ( repainted each frame,
flag is not reset)
0 means that it is not dirty and therefore not repainted again blendmode = 0 its the special_flags argument of blit, blendmodes source_rect = None source rect to use, remember that it is relative to
topleft (0,0) of self.image visible = 1 normally 1, if set to 0 it will not be repainted
(you must set it dirty too to be erased from screen) layer = 0 (READONLY value, it is read when adding it to the
LayeredDirty, for details see doc of LayeredDirty)
add() 
 add Sprites to this Group add(*sprites) -> None  Add any number of Sprites to this Group. This will only add Sprites that are not already members of the Group. Each sprite argument can also be a iterator containing Sprites.
clear() 
 draw a background over the Sprites clear(Surface_dest, background) -> None  Erases the Sprites used in the last Group.draw() call. The destination Surface is cleared by filling the drawn Sprite positions with the background. The background is usually a Surface image the same dimensions as the destination Surface. However, it can also be a callback function that takes two arguments; the destination Surface and an area to clear. The background callback function will be called several times each clear. Here is an example callback that will clear the Sprites with solid red: def clear_callback(surf, rect):
    color = 255, 0, 0
    surf.fill(color, rect)
copy() 
 duplicate the Group copy() -> Group  Creates a new Group with all the same Sprites as the original. If you have subclassed Group, the new object will have the same (sub-)class as the original. This only works if the derived class's constructor takes the same arguments as the Group class's.
draw() 
 blit the Sprite images draw(Surface) -> None  Draws the contained Sprites to the Surface argument. This uses the Sprite.image attribute for the source surface, and Sprite.rect for the position. The Group does not keep sprites in any order, so the draw order is arbitrary.
empty() 
 remove all Sprites empty() -> None  Removes all Sprites from this Group.
has() 
 test if a Group contains Sprites has(*sprites) -> bool  Return True if the Group contains all of the given sprites. This is similar to using the "in" operator on the Group ("if sprite in group: ..."), which tests if a single Sprite belongs to a Group. Each sprite argument can also be a iterator containing Sprites.
remove() 
 remove Sprites from the Group remove(*sprites) -> None  Remove any number of Sprites from the Group. This will only remove Sprites that are already members of the Group. Each sprite argument can also be a iterator containing Sprites.
sprites() 
 list of the Sprites this Group contains sprites() -> sprite_list  Return a list of all the Sprites this group contains. You can also get an iterator from the group, but you cannot iterate over a Group while modifying it.
update() 
 call the update method on contained Sprites update(*args, **kwargs) -> None  Calls the update() method on all Sprites in the Group. The base Sprite class has an update method that takes any number of arguments and does nothing. The arguments passed to Group.update() will be passed to each Sprite. There is no way to get the return value from the Sprite.update() methods.
pygame.sprite.groupcollide() 
 Find all sprites that collide between two groups. groupcollide(group1, group2, dokill1, dokill2, collided = None) -> Sprite_dict  This will find collisions between all the Sprites in two groups. Collision is determined by comparing the Sprite.rect attribute of each Sprite or by using the collided function if it is not None. Every Sprite inside group1 is added to the return dictionary. The value for each item is the list of Sprites in group2 that intersect. If either dokill argument is True, the colliding Sprites will be removed from their respective 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, then all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision.
pygame.sprite.GroupSingle() 
 Group container that holds a single sprite. GroupSingle(sprite=None) -> GroupSingle  The GroupSingle container only holds a single Sprite. When a new Sprite is added, the old one is removed. There is a special property, GroupSingle.sprite, that accesses the Sprite that this Group contains. It can be None when the Group is empty. The property can also be assigned to add a Sprite into the GroupSingle container.
pygame.sprite.LayeredDirty 
 LayeredDirty group is for DirtySprite objects. Subclasses LayeredUpdates. LayeredDirty(*spites, **kwargs) -> LayeredDirty  This group requires pygame.sprite.DirtySprite or any sprite that has the following attributes: image, rect, dirty, visible, blendmode (see doc of DirtySprite). It uses the dirty flag technique and is therefore faster than the pygame.sprite.RenderUpdates if you have many static sprites. It also switches automatically between dirty rect update and full screen drawing, so you do no have to worry what would be faster. Same as for the pygame.sprite.Group. You can specify some additional attributes through kwargs: _use_update: True/False   default is False
_default_layer: default layer where sprites without a layer are added.
_time_threshold: threshold time for switching between dirty rect mode
    and fullscreen mode, defaults to 1000./80  == 1000./fps  New in pygame 1.8.    draw() 
 draw all sprites in the right order onto the passed surface. draw(surface, bgd=None) -> Rect_list  You can pass the background too. If a background is already set, then the bgd argument has no effect. 
   clear() 
 used to set background clear(surface, bgd) -> None  
   repaint_rect() 
 repaints the given area repaint_rect(screen_rect) -> None  screen_rect is in screen coordinates. 
   set_clip() 
 clip the area where to draw. Just pass None (default) to reset the clip set_clip(screen_rect=None) -> None  
   get_clip() 
 clip the area where to draw. Just pass None (default) to reset the clip get_clip() -> Rect  
   change_layer() 
 changes the layer of the sprite change_layer(sprite, new_layer) -> None  sprite must have been added to the renderer. It is not checked. 
   set_timing_treshold() 
 sets the threshold in milliseconds set_timing_treshold(time_ms) -> None  Default is 1000./80 where 80 is the fps I want to switch to full screen mode. This method's name is a typo and should be fixed.     
Raises:

TypeError -- if time_ms is not int or float
change_layer() 
 changes the layer of the sprite change_layer(sprite, new_layer) -> None  sprite must have been added to the renderer. It is not checked.
draw() 
 draw all sprites in the right order onto the passed surface. draw(surface, bgd=None) -> Rect_list  You can pass the background too. If a background is already set, then the bgd argument has no effect.
get_clip() 
 clip the area where to draw. Just pass None (default) to reset the clip get_clip() -> Rect
repaint_rect() 
 repaints the given area repaint_rect(screen_rect) -> None  screen_rect is in screen coordinates.
set_clip() 
 clip the area where to draw. Just pass None (default) to reset the clip set_clip(screen_rect=None) -> None
set_timing_treshold() 
 sets the threshold in milliseconds set_timing_treshold(time_ms) -> None  Default is 1000./80 where 80 is the fps I want to switch to full screen mode. This method's name is a typo and should be fixed.     
Raises:

TypeError -- if time_ms is not int or float
pygame.sprite.LayeredUpdates 
 LayeredUpdates is a sprite group that handles layers and draws like OrderedUpdates. LayeredUpdates(*spites, **kwargs) -> LayeredUpdates  This group is fully compatible with pygame.sprite.Sprite. You can set the default layer through kwargs using 'default_layer' and an integer for the layer. The default layer is 0. If the sprite you add has an attribute _layer then that layer will be used. If the **kwarg contains 'layer' then the sprites passed will be added to that layer (overriding the sprite.layer attribute). If neither sprite has attribute layer nor **kwarg then the default layer is used to add the sprites.  New in pygame 1.8.    add() 
 add a sprite or sequence of sprites to a group add(*sprites, **kwargs) -> None  If the sprite(s) have an attribute layer then that is used for the layer. If **kwargs contains 'layer' then the sprite(s) will be added to that argument (overriding the sprite layer attribute). If neither is passed then the sprite(s) will be added to the default layer. 
   sprites() 
 returns a ordered list of sprites (first back, last top). sprites() -> sprites  
   draw() 
 draw all sprites in the right order onto the passed surface. draw(surface) -> Rect_list  
   get_sprites_at() 
 returns a list with all sprites at that position. get_sprites_at(pos) -> colliding_sprites  Bottom sprites first, top last. 
   get_sprite() 
 returns the sprite at the index idx from the groups sprites get_sprite(idx) -> sprite  Raises IndexOutOfBounds if the idx is not within range. 
   remove_sprites_of_layer() 
 removes all sprites from a layer and returns them as a list. remove_sprites_of_layer(layer_nr) -> sprites  
   layers() 
 returns a list of layers defined (unique), sorted from bottom up. layers() -> layers  
   change_layer() 
 changes the layer of the sprite change_layer(sprite, new_layer) -> None  sprite must have been added to the renderer. It is not checked. 
   get_layer_of_sprite() 
 returns the layer that sprite is currently in. get_layer_of_sprite(sprite) -> layer  If the sprite is not found then it will return the default layer. 
   get_top_layer() 
 returns the top layer get_top_layer() -> layer  
   get_bottom_layer() 
 returns the bottom layer get_bottom_layer() -> 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). 
   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. 
   get_top_sprite() 
 returns the topmost sprite get_top_sprite() -> Sprite  
   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. 
   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.
add() 
 add a sprite or sequence of sprites to a group add(*sprites, **kwargs) -> None  If the sprite(s) have an attribute layer then that is used for the layer. If **kwargs contains 'layer' then the sprite(s) will be added to that argument (overriding the sprite layer attribute). If neither is passed then the sprite(s) will be added to the default layer.
draw() 
 draw all sprites in the right order onto the passed surface. draw(surface) -> Rect_list
get_bottom_layer() 
 returns the bottom layer get_bottom_layer() -> layer
get_layer_of_sprite() 
 returns the layer that sprite is currently in. get_layer_of_sprite(sprite) -> layer  If the sprite is not found then it will return the default layer.
get_sprite() 
 returns the sprite at the index idx from the groups sprites get_sprite(idx) -> sprite  Raises IndexOutOfBounds if the idx is not within range.
get_sprites_at() 
 returns a list with all sprites at that position. get_sprites_at(pos) -> colliding_sprites  Bottom sprites first, top last.