neulab/docprompting-conala huggingface dataset:
set_at() 
 Sets the bit at the given position set_at((x, y)) -> None set_at((x, y), value=1) -> None      
Parameters:

 
pos (tuple(int, int) or list[int, int]) -- the position of the bit to set 
value (int) -- any nonzero int will set the bit to 1, 0 will set the bit to 0 (default is 1)    
Returns:

None   
Return type:

NoneType   
Raises:

IndexError -- if the position is outside of the mask's bounds
to_surface() 
 Returns a surface with the mask drawn on it to_surface() -> Surface to_surface(surface=None, setsurface=None, unsetsurface=None, setcolor=(255, 255, 255, 255), unsetcolor=(0, 0, 0, 255), dest=(0, 0)) -> Surface  Draws this mask on the given surface. Set bits (bits set to 1) and unset bits (bits set to 0) can be drawn onto a surface.     
Parameters:

 
surface (Surface or None) -- (optional) Surface to draw mask onto, if no surface is provided one will be created (default is None, which will cause a surface with the parameters Surface(size=mask.get_size(), flags=SRCALPHA, depth=32) to be created, drawn on, and returned) 
setsurface (Surface or None) -- (optional) use this surface's color values to draw set bits (default is None), if this surface is smaller than the mask any bits outside its bounds will use the setcolor value 
unsetsurface (Surface or None) -- (optional) use this surface's color values to draw unset bits (default is None), if this surface is smaller than the mask any bits outside its bounds will use the unsetcolor value 
setcolor (Color or str or int or tuple(int, int, int, [int]) or list(int, int, int, [int]) or None) -- (optional) color to draw set bits (default is (255, 255, 255, 255), white), use None to skip drawing the set bits, the setsurface parameter (if set) will takes precedence over this parameter 
unsetcolor (Color or str or int or tuple(int, int, int, [int]) or list(int, int, int, [int]) or None) -- (optional) color to draw unset bits (default is (0, 0, 0, 255), black), use None to skip drawing the unset bits, the unsetsurface parameter (if set) will takes precedence over this parameter 
dest (Rect or tuple(int, int) or list(int, int) or Vector2(int, int)) -- (optional) surface destination of where to position the topleft corner of the mask being drawn (default is (0, 0)), if a Rect is used as the dest parameter, its x and y attributes will be used as the destination, NOTE1: rects with a negative width or height value will not be normalized before using their x and y values, NOTE2: this destination value is only used to position the mask on the surface, it does not offset the setsurface and unsetsurface from the mask, they are always aligned with the mask (i.e. position (0, 0) on the mask always corresponds to position (0, 0) on the setsurface and unsetsurface)    
Returns:

the surface parameter (or a newly created surface if no surface parameter was provided) with this mask drawn on it   
Return type:

Surface   
Raises:

ValueError -- if the setsurface parameter or unsetsurface parameter does not have the same format (bytesize/bitsize/alpha) as the surface parameter      Note To skip drawing the set bits, both setsurface and setcolor must be None. The setsurface parameter defaults to None, but setcolor defaults to a color value and therefore must be set to None.   Note To skip drawing the unset bits, both unsetsurface and unsetcolor must be None. The unsetsurface parameter defaults to None, but unsetcolor defaults to a color value and therefore must be set to None.   New in pygame 2.0.0.
pygame.math.disable_swizzling() 
 globally disables swizzling for vectors. disable_swizzling() -> None  DEPRECATED: Not needed anymore. Will be removed in a later version. Disables swizzling for all vectors until enable_swizzling() is called. By default swizzling is disabled.
pygame.math.enable_swizzling() 
 globally enables swizzling for vectors. enable_swizzling() -> None  DEPRECATED: Not needed anymore. Will be removed in a later version. Enables swizzling for all vectors until disable_swizzling() is called. By default swizzling is disabled. Lets you get or set multiple coordinates as one attribute, eg vec.xyz = 1, 2, 3.
angle_to() 
 calculates the angle to a given vector in degrees. angle_to(Vector2) -> float  Returns the angle between self and the given vector.
as_polar() 
 returns a tuple with radial distance and azimuthal angle. as_polar() -> (r, phi)  Returns a tuple (r, phi) where r is the radial distance, and phi is the azimuthal angle.
cross() 
 calculates the cross- or vector-product cross(Vector2) -> Vector2  calculates the third component of the cross-product.
distance_squared_to() 
 calculates the squared Euclidean distance to a given vector. distance_squared_to(Vector2) -> float
distance_to() 
 calculates the Euclidean distance to a given vector. distance_to(Vector2) -> float
dot() 
 calculates the dot- or scalar-product with the other vector dot(Vector2) -> float
elementwise() 
 The next operation will be performed elementwise. elementwise() -> VectorElementwiseProxy  Applies the following operation to each element of the vector.
from_polar() 
 Sets x and y from a polar coordinates tuple. from_polar((r, phi)) -> None  Sets x and y from a tuple (r, phi) where r is the radial distance, and phi is the azimuthal angle.
is_normalized() 
 tests if the vector is normalized i.e. has length == 1. is_normalized() -> Bool  Returns True if the vector has length equal to 1. Otherwise it returns False.
length() 
 returns the Euclidean length of the vector. length() -> float  calculates the Euclidean length of the vector which follows from the Pythagorean theorem: vec.length() == math.sqrt(vec.x**2 + vec.y**2)
length_squared() 
 returns the squared Euclidean length of the vector. length_squared() -> float  calculates the Euclidean length of the vector which follows from the Pythagorean theorem: vec.length_squared() == vec.x**2 + vec.y**2. This is faster than vec.length() because it avoids the square root.
lerp() 
 returns a linear interpolation to the given vector. lerp(Vector2, float) -> Vector2  Returns a Vector which is a linear interpolation between self and the given Vector. The second parameter determines how far between self and other the result is going to be. It must be a value between 0 and 1 where 0 means self and 1 means other will be returned.
magnitude() 
 returns the Euclidean magnitude of the vector. magnitude() -> float  calculates the magnitude of the vector which follows from the theorem: vec.magnitude() == math.sqrt(vec.x**2 + vec.y**2)
magnitude_squared() 
 returns the squared magnitude of the vector. magnitude_squared() -> float  calculates the magnitude of the vector which follows from the theorem: vec.magnitude_squared() == vec.x**2 + vec.y**2. This is faster than vec.magnitude() because it avoids the square root.
normalize() 
 returns a vector with the same direction but length 1. normalize() -> Vector2  Returns a new vector that has length equal to 1 and the same direction as self.
normalize_ip() 
 normalizes the vector in place so that its length is 1. normalize_ip() -> None  Normalizes the vector so that it has length equal to 1. The direction of the vector is not changed.
reflect() 
 returns a vector reflected of a given normal. reflect(Vector2) -> Vector2  Returns a new vector that points in the direction as if self would bounce of a surface characterized by the given surface normal. The length of the new vector is the same as self's.
reflect_ip() 
 reflect the vector of a given normal in place. reflect_ip(Vector2) -> None  Changes the direction of self as if it would have been reflected of a surface with the given surface normal.
rotate() 
 rotates a vector by a given angle in degrees. rotate(angle) -> Vector2  Returns a vector which has the same length as self but is rotated counterclockwise by the given angle in degrees.
rotate_ip() 
 rotates the vector by a given angle in degrees in place. rotate_ip(angle) -> None  Rotates the vector counterclockwise by the given angle in degrees. The length of the vector is not changed.
rotate_ip_rad() 
 rotates the vector by a given angle in radians in place. rotate_ip_rad(angle) -> None  Rotates the vector counterclockwise by the given angle in radians. The length of the vector is not changed.  New in pygame 2.0.0.
rotate_rad() 
 rotates a vector by a given angle in radians. rotate_rad(angle) -> Vector2  Returns a vector which has the same length as self but is rotated counterclockwise by the given angle in radians.  New in pygame 2.0.0.
scale_to_length() 
 scales the vector to a given length. scale_to_length(float) -> None  Scales the vector so that it has the given length. The direction of the vector is not changed. You can also scale to length 0. If the vector is the zero vector (i.e. has length 0 thus no direction) a ValueError is raised.
slerp() 
 returns a spherical interpolation to the given vector. slerp(Vector2, float) -> Vector2  Calculates the spherical interpolation from self to the given Vector. The second argument - often called t - must be in the range [-1, 1]. It parametrizes where - in between the two vectors - the result should be. If a negative value is given the interpolation will not take the complement of the shortest path.
update() 
 Sets the coordinates of the vector. update() -> None update(int) -> None update(float) -> None update(Vector2) -> None update(x, y) -> None update((x, y)) -> None  Sets coordinates x and y in place.  New in pygame 1.9.5.
angle_to() 
 calculates the angle to a given vector in degrees. angle_to(Vector3) -> float  Returns the angle between self and the given vector.
as_spherical() 
 returns a tuple with radial distance, inclination and azimuthal angle. as_spherical() -> (r, theta, phi)  Returns a tuple (r, theta, phi) where r is the radial distance, theta is the inclination angle and phi is the azimuthal angle.
cross() 
 calculates the cross- or vector-product cross(Vector3) -> Vector3  calculates the cross-product.
distance_squared_to() 
 calculates the squared Euclidean distance to a given vector. distance_squared_to(Vector3) -> float
distance_to() 
 calculates the Euclidean distance to a given vector. distance_to(Vector3) -> float
dot() 
 calculates the dot- or scalar-product with the other vector dot(Vector3) -> float
from_spherical() 
 Sets x, y and z from a spherical coordinates 3-tuple. from_spherical((r, theta, phi)) -> None  Sets x, y and z from a tuple (r, theta, phi) where r is the radial distance, theta is the inclination angle and phi is the azimuthal angle.
length() 
 returns the Euclidean length of the vector. length() -> float  calculates the Euclidean length of the vector which follows from the Pythagorean theorem: vec.length() == math.sqrt(vec.x**2 + vec.y**2 + vec.z**2)
length_squared() 
 returns the squared Euclidean length of the vector. length_squared() -> float  calculates the Euclidean length of the vector which follows from the Pythagorean theorem: vec.length_squared() == vec.x**2 + vec.y**2 + vec.z**2. This is faster than vec.length() because it avoids the square root.
lerp() 
 returns a linear interpolation to the given vector. lerp(Vector3, float) -> Vector3  Returns a Vector which is a linear interpolation between self and the given Vector. The second parameter determines how far between self an other the result is going to be. It must be a value between 0 and 1, where 0 means self and 1 means other will be returned.
magnitude() 
 returns the Euclidean magnitude of the vector. magnitude() -> float  calculates the magnitude of the vector which follows from the theorem: vec.magnitude() == math.sqrt(vec.x**2 + vec.y**2 + vec.z**2)
magnitude_squared() 
 returns the squared Euclidean magnitude of the vector. magnitude_squared() -> float  calculates the magnitude of the vector which follows from the theorem: vec.magnitude_squared() == vec.x**2 + vec.y**2 + vec.z**2. This is faster than vec.magnitude() because it avoids the square root.
normalize() 
 returns a vector with the same direction but length 1. normalize() -> Vector3  Returns a new vector that has length equal to 1 and the same direction as self.
reflect() 
 returns a vector reflected of a given normal. reflect(Vector3) -> Vector3  Returns a new vector that points in the direction as if self would bounce of a surface characterized by the given surface normal. The length of the new vector is the same as self's.
reflect_ip() 
 reflect the vector of a given normal in place. reflect_ip(Vector3) -> None  Changes the direction of self as if it would have been reflected of a surface with the given surface normal.
rotate() 
 rotates a vector by a given angle in degrees. rotate(angle, Vector3) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise by the given angle in degrees around the given axis.
rotate_ip() 
 rotates the vector by a given angle in degrees in place. rotate_ip(angle, Vector3) -> None  Rotates the vector counterclockwise around the given axis by the given angle in degrees. The length of the vector is not changed.
rotate_ip_rad() 
 rotates the vector by a given angle in radians in place. rotate_ip_rad(angle, Vector3) -> None  Rotates the vector counterclockwise around the given axis by the given angle in radians. The length of the vector is not changed.  New in pygame 2.0.0.
rotate_rad() 
 rotates a vector by a given angle in radians. rotate_rad(angle, Vector3) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise by the given angle in radians around the given axis.  New in pygame 2.0.0.
rotate_x() 
 rotates a vector around the x-axis by the angle in degrees. rotate_x(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the x-axis by the given angle in degrees.
rotate_x_ip() 
 rotates the vector around the x-axis by the angle in degrees in place. rotate_x_ip(angle) -> None  Rotates the vector counterclockwise around the x-axis by the given angle in degrees. The length of the vector is not changed.
rotate_x_ip_rad() 
 rotates the vector around the x-axis by the angle in radians in place. rotate_x_ip_rad(angle) -> None  Rotates the vector counterclockwise around the x-axis by the given angle in radians. The length of the vector is not changed.  New in pygame 2.0.0.
rotate_x_rad() 
 rotates a vector around the x-axis by the angle in radians. rotate_x_rad(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the x-axis by the given angle in radians.  New in pygame 2.0.0.
rotate_y() 
 rotates a vector around the y-axis by the angle in degrees. rotate_y(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the y-axis by the given angle in degrees.
rotate_y_ip() 
 rotates the vector around the y-axis by the angle in degrees in place. rotate_y_ip(angle) -> None  Rotates the vector counterclockwise around the y-axis by the given angle in degrees. The length of the vector is not changed.
rotate_y_ip_rad() 
 rotates the vector around the y-axis by the angle in radians in place. rotate_y_ip_rad(angle) -> None  Rotates the vector counterclockwise around the y-axis by the given angle in radians. The length of the vector is not changed.  New in pygame 2.0.0.
rotate_y_rad() 
 rotates a vector around the y-axis by the angle in radians. rotate_y_rad(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the y-axis by the given angle in radians.  New in pygame 2.0.0.
rotate_z() 
 rotates a vector around the z-axis by the angle in degrees. rotate_z(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the z-axis by the given angle in degrees.
rotate_z_ip() 
 rotates the vector around the z-axis by the angle in degrees in place. rotate_z_ip(angle) -> None  Rotates the vector counterclockwise around the z-axis by the given angle in degrees. The length of the vector is not changed.
rotate_z_ip_rad() 
 rotates the vector around the z-axis by the angle in radians in place. rotate_z_ip_rad(angle) -> None  Rotates the vector counterclockwise around the z-axis by the given angle in radians. The length of the vector is not changed.
rotate_z_rad() 
 rotates a vector around the z-axis by the angle in radians. rotate_z_rad(angle) -> Vector3  Returns a vector which has the same length as self but is rotated counterclockwise around the z-axis by the given angle in radians.  New in pygame 2.0.0.
slerp() 
 returns a spherical interpolation to the given vector. slerp(Vector3, float) -> Vector3  Calculates the spherical interpolation from self to the given Vector. The second argument - often called t - must be in the range [-1, 1]. It parametrizes where - in between the two vectors - the result should be. If a negative value is given the interpolation will not take the complement of the shortest path.
update() 
 Sets the coordinates of the vector. update() -> None update(int) -> None update(float) -> None update(Vector3) -> None update(x, y, z) -> None update((x, y, z)) -> None  Sets coordinates x, y, and z in place.  New in pygame 1.9.5.
pygame.midi.frequency_to_midi() 
 Converts a frequency into a MIDI note. Rounds to the closest midi note. frequency_to_midi(midi_note) -> midi_note  example: frequency_to_midi(27.5) == 21  New in pygame 1.9.5.
pygame.midi.get_count() 
 gets the number of devices. get_count() -> num_devices  Device ids range from 0 to get_count() - 1
pygame.midi.get_default_input_id() 
 gets default input device number get_default_input_id() -> default_id  The following describes the usage details for this function and the get_default_output_id() function. Return the default device ID or -1 if there are no devices. The result can be passed to the Input/Output class. On a PC the user can specify a default device by setting an environment variable. To use device #1, for example: set PM_RECOMMENDED_INPUT_DEVICE=1
or
set PM_RECOMMENDED_OUTPUT_DEVICE=1 The user should first determine the available device ID by using the supplied application "testin" or "testout". In general, the registry is a better place for this kind of info. With USB devices that can come and go, using integers is not very reliable for device identification. Under Windows, if PM_RECOMMENDED_INPUT_DEVICE (or PM_RECOMMENDED_OUTPUT_DEVICE) is NOT found in the environment, then the default device is obtained by looking for a string in the registry under: HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device
or
HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device The number of the first device with a substring that matches the string exactly is returned. For example, if the string in the registry is "USB" and device 1 is named "In USB MidiSport 1x1", then that will be the default input because it contains the string "USB". In addition to the name, get_device_info() returns "interf", which is the interface name. The "interface" is the underlying software system or API used by PortMidi to access devices. Supported interfaces: MMSystem   # the only Win32 interface currently supported
ALSA       # the only Linux interface currently supported
CoreMIDI   # the only Mac OS X interface currently supported
# DirectX - not implemented
# OSS     - not implemented To specify both the interface and the device name in the registry, separate the two with a comma and a space. The string before the comma must be a substring of the "interf" string and the string after the space must be a substring of the "name" name string in order to match the device. e.g.: MMSystem, In USB MidiSport 1x1  Note In the current release, the default is simply the first device (the input or output device with the lowest PmDeviceID).
pygame.midi.get_default_output_id() 
 gets default output device number get_default_output_id() -> default_id  See get_default_input_id() for usage details.
pygame.midi.get_device_info() 
 returns information about a midi device get_device_info(an_id) -> (interf, name, input, output, opened) get_device_info(an_id) -> None  Gets the device info for a given id.     
Parameters:

an_id (int) -- id of the midi device being queried  
Returns:
if the id is out of range None is returned, otherwise a tuple of (interf, name, input, output, opened) is returned. 
 interf: string describing the device interface (e.g. 'ALSA') name: string name of the device (e.g. 'Midi Through Port-0') input: 1 if the device is an input device, otherwise 0 output: 1 if the device is an output device, otherwise 0 opened: 1 if the device is opened, otherwise 0  
   
Return type:
tuple or None
pygame.midi.get_init() 
 returns True if the midi module is currently initialized get_init() -> bool  Gets the initialization state of the pygame.midi module.     
Returns:

True if the pygame.midi module is currently initialized.  
Return type:
bool     New in pygame 1.9.5.
pygame.midi.init() 
 initialize the midi module init() -> None  Initializes the pygame.midi module. Must be called before using the pygame.midi module. It is safe to call this more than once.
pygame.midi.Input 
 Input is used to get midi input from midi devices. Input(device_id) -> None Input(device_id, buffer_size) -> None      
Parameters:

 
device_id (int) -- midi device id 
buffer_size (int) -- (optional) the number of input events to be buffered        close() 
 closes a midi stream, flushing any pending buffers. close() -> None  PortMidi attempts to close open streams when the application exits.  Note This is particularly difficult under Windows.  
   poll() 
 returns True if there's data, or False if not. poll() -> bool  Used to indicate if any data exists.     
Returns:

True if there is data, False otherwise  
Return type:
bool  
Raises:

MidiException -- on error    
   read() 
 reads num_events midi events from the buffer. read(num_events) -> midi_event_list  Reads from the input buffer and gives back midi events.     
Parameters:

num_events (int) -- number of input events to read  
Returns:
the format for midi_event_list is [[[status, data1, data2, data3], timestamp], ...]
  
Return type:
list
close() 
 closes a midi stream, flushing any pending buffers. close() -> None  PortMidi attempts to close open streams when the application exits.  Note This is particularly difficult under Windows.
poll() 
 returns True if there's data, or False if not. poll() -> bool  Used to indicate if any data exists.     
Returns:

True if there is data, False otherwise  
Return type:
bool  
Raises:

MidiException -- on error
read() 
 reads num_events midi events from the buffer. read(num_events) -> midi_event_list  Reads from the input buffer and gives back midi events.     
Parameters:

num_events (int) -- number of input events to read  
Returns:
the format for midi_event_list is [[[status, data1, data2, data3], timestamp], ...]
  
Return type:
list
pygame.midi.midi_to_ansi_note() 
 Returns the Ansi Note name for a midi number. midi_to_ansi_note(midi_note) -> ansi_note  example: midi_to_ansi_note(21) == 'A0'  New in pygame 1.9.5.
pygame.midi.midi_to_frequency() 
 Converts a midi note to a frequency. midi_to_frequency(midi_note) -> frequency  example: midi_to_frequency(21) == 27.5  New in pygame 1.9.5.
exception pygame.midi.MidiException 
 exception that pygame.midi functions and classes can raise MidiException(errno) -> None
pygame.midi.midis2events() 
 converts midi events to pygame events midis2events(midi_events, device_id) -> [Event, ...]  Takes a sequence of midi events and returns list of pygame events. The midi_events data is expected to be a sequence of ((status, data1, data2, data3), timestamp) midi events (all values required).     
Returns:
a list of pygame events of event type MIDIIN
  
Return type:
list
abort() 
 terminates outgoing messages immediately abort() -> None  The caller should immediately close the output port; this call may result in transmission of a partial midi message. There is no abort for Midi input because the user can simply ignore messages in the buffer and close an input device at any time.
note_off() 
 turns a midi note off (note must be on) note_off(note, velocity=None, channel=0) -> None  Turn a note off in the output stream. The note must already be on for this to work correctly.