neulab/docprompting-conala huggingface dataset:
get_axis() 
 get the current position of an axis get_axis(axis_number) -> float  Returns the current position of a joystick axis. The value will range from -1 to 1 with a value of 0 being centered. You may want to take into account some tolerance to handle jitter, and joystick drift may keep the joystick from centering at 0 or using the full range of position values. The axis number must be an integer from 0 to get_numaxes() - 1. When using gamepads both the control sticks and the analog triggers are usually reported as axes.
get_ball() 
 get the relative position of a trackball get_ball(ball_number) -> x, y  Returns the relative movement of a joystick button. The value is a x, y pair holding the relative movement since the last call to get_ball. The ball number must be an integer from 0 to get_numballs() - 1.
get_button() 
 get the current button state get_button(button) -> bool  Returns the current state of a joystick button.
get_guid() → str 
 get the joystick GUID get_guid() -> str  Get the GUID string. This identifies the exact hardware of the joystick device.  New in pygame 2.0.0dev11.
get_hat() 
 get the position of a joystick hat get_hat(hat_number) -> x, y  Returns the current position of a position hat. The position is given as two values representing the x and y position for the hat. (0, 0) means centered. A value of -1 means left/down and a value of 1 means right/up: so (-1, 0) means left; (1, 0) means right; (0, 1) means up; (1, 1) means upper-right; etc. This value is digital, i.e., each coordinate can be -1, 0 or 1 but never in-between. The hat number must be between 0 and get_numhats() - 1.
get_id() 
 get the device index (deprecated) get_id() -> int  Returns the original device index for this device. This is the same value that was passed to the Joystick() constructor. This method can safely be called while the Joystick is not initialized.  Deprecated since pygame 2.0.0: The original device index is not useful in pygame 2. Use get_instance_id() instead. Will be removed in Pygame 2.1.
get_init() 
 check if the Joystick is initialized get_init() -> bool  Return True if the Joystick object is currently initialised.
get_instance_id() → int 
 get the joystick instance id get_instance_id() -> int  Get the joystick instance ID. This matches the instance_id field that is given in joystick events.  New in pygame 2.0.0dev11.
get_name() 
 get the Joystick system name get_name() -> string  Returns the system name for this joystick device. It is unknown what name the system will give to the Joystick, but it should be a unique name that identifies the device. This method can safely be called while the Joystick is not initialized.
get_numaxes() 
 get the number of axes on a Joystick get_numaxes() -> int  Returns the number of input axes are on a Joystick. There will usually be two for the position. Controls like rudders and throttles are treated as additional axes. The pygame.JOYAXISMOTION events will be in the range from -1.0 to 1.0. A value of 0.0 means the axis is centered. Gamepad devices will usually be -1, 0, or 1 with no values in between. Older analog joystick axes will not always use the full -1 to 1 range, and the centered value will be some area around 0. Analog joysticks usually have a bit of noise in their axis, which will generate a lot of rapid small motion events.
get_numballs() 
 get the number of trackballs on a Joystick get_numballs() -> int  Returns the number of trackball devices on a Joystick. These devices work similar to a mouse but they have no absolute position; they only have relative amounts of movement. The pygame.JOYBALLMOTION event will be sent when the trackball is rolled. It will report the amount of movement on the trackball.
get_numbuttons() 
 get the number of buttons on a Joystick get_numbuttons() -> int  Returns the number of pushable buttons on the joystick. These buttons have a boolean (on or off) state. Buttons generate a pygame.JOYBUTTONDOWN and pygame.JOYBUTTONUP event when they are pressed and released.
get_numhats() 
 get the number of hat controls on a Joystick get_numhats() -> int  Returns the number of joystick hats on a Joystick. Hat devices are like miniature digital joysticks on a joystick. Each hat has two axes of input. The pygame.JOYHATMOTION event is generated when the hat changes position. The position attribute for the event contains a pair of values that are either -1, 0, or 1. A position of (0, 0) means the hat is centered.
get_power_level() → str 
 get the approximate power status of the device get_power_level() -> str  Get a string giving the power status of the device. One of: empty, low, medium, full, wired, max, or unknown.  New in pygame 2.0.0dev11.
init() 
 initialize the Joystick init() -> None  Initialize the joystick, if it has been closed. It is safe to call this even if the joystick is already initialized.  Deprecated since pygame 2.0.0: In future it will not be possible to reinitialise a closed Joystick object. Will be removed in Pygame 2.1.
quit() 
 uninitialize the Joystick quit() -> None  Close a Joystick object. After this the pygame event queue will no longer receive events from the device. It is safe to call this more than once.
pygame.joystick.quit() 
 Uninitialize the joystick module. quit() -> None  Uninitialize the joystick module. After you call this any existing joystick objects will no longer work. It is safe to call this function more than once.
pygame.key.get_focused() 
 true if the display is receiving keyboard input from the system get_focused() -> bool  Returns True when the display window has keyboard focus from the system. If the display needs to ensure it does not lose keyboard focus, it can use pygame.event.set_grab() to grab all input.
pygame.key.get_mods() 
 determine which modifier keys are being held get_mods() -> int  Returns a single integer representing a bitmask of all the modifier keys being held. Using bitwise operators you can test if specific modifier keys are pressed.
pygame.key.get_pressed() 
 get the state of all keyboard buttons get_pressed() -> bools  Returns a sequence of boolean values representing the state of every key on the keyboard. Use the key constant values to index the array. A True value means the that button is pressed.  Note Getting the list of pushed buttons with this function is not the proper way to handle text entry from the user. There is no way to know the order of keys pressed, and rapidly pushed keys can be completely unnoticed between two calls to pygame.key.get_pressed(). There is also no way to translate these pushed keys into a fully translated character value. See the pygame.KEYDOWN events on the pygame.event queue for this functionality.
pygame.key.get_repeat() 
 see how held keys are repeated get_repeat() -> (delay, interval)  Get the delay and interval keyboard repeat values. Refer to pygame.key.set_repeat() for a description of these values.  New in pygame 1.8.
pygame.key.key_code() 
 get the key identifier from a key name key_code(name=string) -> int  Get the key identifier code from the descriptive name of the key. This returns an integer matching one of the K_* keycodes. For example: >>> pygame.key.key_code("return") == pygame.K_RETURN
True
>>> pygame.key.key_code("0") == pygame.K_0
True
>>> pygame.key.key_code("space") == pygame.K_SPACE
True     
Raises:

 
ValueError -- if the key name is not known. 
NotImplementedError -- if used with SDL 1.       New in pygame 2.0.0.
pygame.key.name() 
 get the name of a key identifier name(key) -> string  Get the descriptive name of the button from a keyboard button id constant.
pygame.key.set_mods() 
 temporarily set which modifier keys are pressed set_mods(int) -> None  Create a bitmask of the modifier key constants you want to impose on your program.
pygame.key.set_repeat() 
 control how held keys are repeated set_repeat() -> None set_repeat(delay) -> None set_repeat(delay, interval) -> None  When the keyboard repeat is enabled, keys that are held down will generate multiple pygame.KEYDOWN events. The delay parameter is the number of milliseconds before the first repeated pygame.KEYDOWN event will be sent. After that, another pygame.KEYDOWN event will be sent every interval milliseconds. If a delay value is provided and an interval value is not provided or is 0, then the interval will be set to the same value as delay. To disable key repeat call this function with no arguments or with delay set to 0. When pygame is initialized the key repeat is disabled.     
Raises:

ValueError -- if delay or interval is < 0     Changed in pygame 2.0.0: A ValueError is now raised (instead of a pygame.error) if delay or interval is < 0.
pygame.key.set_text_input_rect() 
 controls the position of the candidate list set_text_input_rect(Rect) -> None  This sets the rectangle used for typing with an IME. It controls where the candidate list will open, if supported.  New in pygame 2.0.0.
pygame.key.start_text_input() 
 start handling Unicode text input events start_text_input() -> None  Start receiving pygame.TEXTEDITING and pygame.TEXTINPUT events. A pygame.TEXTEDITING event is received when an IME composition is started or changed. It contains the composition text, length, and editing start position within the composition (attributes text, length, and start, respectively). When the composition is committed (or non-IME input is received), a pygame.TEXTINPUT event is generated. Text input events handling is on by default.  New in pygame 2.0.0.
pygame.key.stop_text_input() 
 stop handling Unicode text input events stop_text_input() -> None  Stop receiving pygame.TEXTEDITING and pygame.TEXTINPUT events. Text input events handling is on by default  New in pygame 2.0.0.
pygame.locals
  
 pygame constants  This module contains various constants used by pygame. Its contents are automatically placed in the pygame module namespace. However, an application can use pygame.locals to include only the pygame constants with a from
pygame.locals import *. Detailed descriptions of the various constants can be found throughout the pygame documentation. Here are the locations of some of them.  
 The pygame.display module contains flags like HWSURFACE used by pygame.display.set_mode(). The pygame.event module contains the various event types. The pygame.key module lists the keyboard constants and modifiers (K_* and MOD_*) relating to the key and mod attributes of the KEYDOWN and KEYUP events. The pygame.time module defines TIMER_RESOLUTION.
pygame.mask.from_surface() 
 Creates a Mask from the given surface from_surface(Surface) -> Mask from_surface(Surface, threshold=127) -> Mask  Creates a Mask object from the given surface by setting all the opaque pixels and not setting the transparent pixels. If the surface uses a color-key, then it is used to decide which bits in the resulting mask are set. All the pixels that are not equal to the color-key are set and the pixels equal to the color-key are not set. If a color-key is not used, then the alpha value of each pixel is used to decide which bits in the resulting mask are set. All the pixels that have an alpha value greater than the threshold parameter are set and the pixels with an alpha value less than or equal to the threshold are not set.     
Parameters:

 
surface (Surface) -- the surface to create the mask from 
threshold (int) -- (optional) the alpha threshold (default is 127) to compare with each surface pixel's alpha value, if the surface is color-keyed this parameter is ignored    
Returns:

a newly created Mask object from the given surface   
Return type:

Mask      Note This function is used to create the masks for pygame.sprite.collide_mask().
pygame.mask.from_threshold() 
 Creates a mask by thresholding Surfaces from_threshold(Surface, color) -> Mask from_threshold(Surface, color, threshold=(0, 0, 0, 255), othersurface=None, palette_colors=1) -> Mask  This is a more featureful method of getting a Mask from a surface. If the optional othersurface is not used, all the pixels within the threshold of the color parameter are set in the resulting mask. If the optional othersurface is used, every pixel in the first surface that is within the threshold of the corresponding pixel in othersurface is set in the resulting mask.     
Parameters:

 
surface (Surface) -- the surface to create the mask from 
color (Color or int or tuple(int, int, int, [int]) or list[int, int, int, [int]]) -- color used to check if the surface's pixels are within the given threshold range, this parameter is ignored if the optional othersurface parameter is supplied 
threshold (Color or int or tuple(int, int, int, [int]) or list[int, int, int, [int]]) -- (optional) the threshold range used to check the difference between two colors (default is (0, 0, 0, 255)) 
othersurface (Surface) -- (optional) used to check whether the pixels of the first surface are within the given threshold range of the pixels from this surface (default is None) 
palette_colors (int) -- (optional) indicates whether to use the palette colors or not, a nonzero value causes the palette colors to be used and a 0 causes them not to be used (default is 1)    
Returns:

a newly created Mask object from the given surface   
Return type:

Mask
angle() 
 Returns the orientation of the set bits angle() -> theta  Finds the approximate orientation (from -90 to 90 degrees) of the set bits in the mask. This works best if performed on a mask with only one connected component.     
Returns:
the orientation of the set bits in the mask, it will return 0.0 if the mask has no bits set  
Return type:
float     Note See connected_component() for details on how a connected component is calculated.
centroid() 
 Returns the centroid of the set bits centroid() -> (x, y)  Finds the centroid (the center mass of the set bits) for this mask.     
Returns:
a coordinate tuple indicating the centroid of the mask, it will return (0, 0) if the mask has no bits set  
Return type:
tuple(int, int)
clear() 
 Sets all bits to 0 clear() -> None  Sets all bits in the mask to 0.     
Returns:
None  
Return type:
NoneType
connected_component() 
 Returns a mask containing a connected component connected_component() -> Mask connected_component((x, y)) -> Mask  A connected component is a group (1 or more) of connected set bits (orthogonally and diagonally). The SAUF algorithm, which checks 8 point connectivity, is used to find a connected component in the mask. By default this method will return a Mask containing the largest connected component in the mask. Optionally, a bit coordinate can be specified and the connected component containing it will be returned. If the bit at the given location is not set, the returned Mask will be empty (no bits set).     
Parameters:

pos (tuple(int, int) or list[int, int]) -- (optional) selects the connected component that contains the bit at this position  
Returns:
a Mask object (same size as this mask) with the largest connected component from this mask, if this mask has no bits set then an empty mask will be returnedIf the pos parameter is provided then the mask returned will have the connected component that contains this position. An empty mask will be returned if the pos parameter selects an unset bit.   
Return type:
Mask  
Raises:

IndexError -- if the optional pos parameter is outside of the mask's bounds
connected_components() 
 Returns a list of masks of connected components connected_components() -> [Mask, ...] connected_components(min=0) -> [Mask, ...]  Provides a list containing a Mask object for each connected component.     
Parameters:

min (int) -- (optional) indicates the minimum number of bits (to filter out noise) per connected component (default is 0, which equates to no minimum and is equivalent to setting it to 1, as a connected component must have at least 1 bit set)  
Returns:
a list containing a Mask object for each connected component, an empty list is returned if the mask has no bits set  
Return type:
list[Mask]     Note See connected_component() for details on how a connected component is calculated.
convolve() 
 Returns the convolution of this mask with another mask convolve(othermask) -> Mask convolve(othermask, outputmask=None, offset=(0, 0)) -> Mask  Convolve this mask with the given othermask.     
Parameters:

 
othermask (Mask) -- mask to convolve this mask with 
outputmask (Mask or NoneType) -- (optional) mask for output (default is None) 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, (default is (0, 0))    
Returns:

a Mask with the (i - offset[0], j - offset[1]) bit set, if shifting othermask (such that its bottom right corner is at (i, j)) causes it to overlap with this mask If an outputmask is specified, the output is drawn onto it and it is returned. Otherwise a mask of size (MAX(0, width + othermask's
width - 1), MAX(0, height + othermask's height - 1)) is created and returned.   
Return type:

Mask
copy() 
 Returns a new copy of the mask copy() -> Mask      
Returns:
a new copy of this mask, the new mask will have the same width, height, and set/unset bits as the original  
Return type:
Mask     Note If a mask subclass needs to copy any instance specific attributes then it should override the __copy__() method. The overridden __copy__() method needs to call super().__copy__() and then copy the required data as in the following example code. class SubMask(pygame.mask.Mask):
    def __copy__(self):
        new_mask = super().__copy__()
        # Do any SubMask attribute copying here.
        return new_mask   New in pygame 2.0.0.
count() 
 Returns the number of set bits count() -> bits      
Returns:
the number of set bits in the mask  
Return type:
int
draw() 
 Draws a mask onto another draw(othermask, offset) -> None  Performs a bitwise OR, drawing othermask onto this mask.     
Parameters:

 
othermask (Mask) -- the mask to draw onto this mask 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, for more details refer to the Mask offset notes
    
Returns:

None   
Return type:

NoneType
erase() 
 Erases a mask from another erase(othermask, offset) -> None  Erases (clears) all bits set in othermask from this mask.     
Parameters:

 
othermask (Mask) -- the mask to erase from this mask 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, for more details refer to the Mask offset notes
    
Returns:

None   
Return type:

NoneType
fill() 
 Sets all bits to 1 fill() -> None  Sets all bits in the mask to 1.     
Returns:
None  
Return type:
NoneType
get_at() 
 Gets the bit at the given position get_at((x, y)) -> int      
Parameters:

pos (tuple(int, int) or list[int, int]) -- the position of the bit to get  
Returns:
1 if the bit is set, 0 if the bit is not set  
Return type:
int  
Raises:

IndexError -- if the position is outside of the mask's bounds
get_bounding_rects() 
 Returns a list of bounding rects of connected components get_bounding_rects() -> [Rect, ...]  Provides a list containing a bounding rect for each connected component.     
Returns:
a list containing a bounding rect for each connected component, an empty list is returned if the mask has no bits set  
Return type:
list[Rect]     Note See connected_component() for details on how a connected component is calculated.
get_rect() 
 Returns a Rect based on the size of the mask get_rect(**kwargs) -> Rect  Returns a new pygame.Rect() object based on the size of this mask. The rect's default position will be (0, 0) and its default width and height will be the same as this mask's. The rect's attributes can be altered via pygame.Rect() attribute keyword arguments/values passed into this method. As an example, a_mask.get_rect(center=(10, 5)) would create a pygame.Rect() based on the mask's size centered at the given position.     
Parameters:

kwargs (dict) -- pygame.Rect() attribute keyword arguments/values that will be applied to the rect  
Returns:
a new pygame.Rect() object based on the size of this mask with any pygame.Rect() attribute keyword arguments/values applied to it  
Return type:
Rect     New in pygame 2.0.0.
get_size() 
 Returns the size of the mask get_size() -> (width, height)      
Returns:
the size of the mask, (width, height)  
Return type:
tuple(int, int)
invert() 
 Flips all the bits invert() -> None  Flips all of the bits in the mask. All the set bits are cleared to 0 and all the unset bits are set to 1.     
Returns:
None  
Return type:
NoneType
outline() 
 Returns a list of points outlining an object outline() -> [(x, y), ...] outline(every=1) -> [(x, y), ...]  Returns a list of points of the outline of the first connected component encountered in the mask. To find a connected component, the mask is searched per row (left to right) starting in the top left corner. The every optional parameter skips set bits in the outline. For example, setting it to 10 would return a list of every 10th set bit in the outline.     
Parameters:

every (int) -- (optional) indicates the number of bits to skip over in the outline (default is 1)  
Returns:
a list of points outlining the first connected component encountered, an empty list is returned if the mask has no bits set  
Return type:
list[tuple(int, int)]     Note See connected_component() for details on how a connected component is calculated.
overlap() 
 Returns the point of intersection overlap(othermask, offset) -> (x, y) overlap(othermask, offset) -> None  Returns the first point of intersection encountered between this mask and othermask. A point of intersection is 2 overlapping set bits. The current algorithm searches the overlapping area in sizeof(unsigned long int) * CHAR_BIT bit wide column blocks (the value of sizeof(unsigned long int) * CHAR_BIT is platform dependent, for clarity it will be referred to as W). Starting at the top left corner it checks bits 0 to W - 1 of the first row ((0, 0) to (W - 1, 0)) then continues to the next row ((0, 1) to (W - 1, 1)). Once this entire column block is checked, it continues to the next one (W to 2 * W - 1). This is repeated until it finds a point of intersection or the entire overlapping area is checked.     
Parameters:

 
othermask (Mask) -- the other mask to overlap with this mask 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, for more details refer to the Mask offset notes
    
Returns:

point of intersection or None if no intersection   
Return type:

tuple(int, int) or NoneType
overlap_area() 
 Returns the number of overlapping set bits overlap_area(othermask, offset) -> numbits  Returns the number of overlapping set bits between between this mask and othermask. This can be useful for collision detection. An approximate collision normal can be found by calculating the gradient of the overlapping area through the finite difference. dx = mask.overlap_area(othermask, (x + 1, y)) - mask.overlap_area(othermask, (x - 1, y))
dy = mask.overlap_area(othermask, (x, y + 1)) - mask.overlap_area(othermask, (x, y - 1))     
Parameters:

 
othermask (Mask) -- the other mask to overlap with this mask 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, for more details refer to the Mask offset notes
    
Returns:

the number of overlapping set bits   
Return type:

int
overlap_mask() 
 Returns a mask of the overlapping set bits overlap_mask(othermask, offset) -> Mask  Returns a Mask, the same size as this mask, containing the overlapping set bits between this mask and othermask.     
Parameters:

 
othermask (Mask) -- the other mask to overlap with this mask 
offset (tuple(int, int) or list[int, int]) -- the offset of othermask from this mask, for more details refer to the Mask offset notes
    
Returns:

a newly created Mask with the overlapping bits set   
Return type:

Mask
scale() 
 Resizes a mask scale((width, height)) -> Mask  Creates a new Mask of the requested size with its bits scaled from this mask.     
Parameters:

size (tuple(int, int) or list[int, int]) -- the width and height (size) of the mask to create  
Returns:
a new Mask object with its bits scaled from this mask  
Return type:
Mask  
Raises:

ValueError -- if width < 0 or height < 0