neulab/docprompting-conala huggingface dataset:
get_view() 
 return a buffer view of the Surface's pixels. get_view(<kind>='2') -> BufferProxy  Return an object which exports a surface's internal pixel buffer as a C level array struct, Python level array interface or a C level buffer interface. The pixel buffer is writeable. The new buffer protocol is supported for Python 2.6 and up in CPython. The old buffer protocol is also supported for Python 2.x. The old buffer data is in one segment for kind '0', multi-segment for other buffer view kinds. The kind argument is the length 1 string '0', '1', '2', '3', 'r', 'g', 'b', or 'a'. The letters are case insensitive; 'A' will work as well. The argument can be either a Unicode or byte (char) string. The default is '2'. '0' returns a contiguous unstructured bytes view. No surface shape information is given. A ValueError is raised if the surface's pixels are discontinuous. '1' returns a (surface-width * surface-height) array of continuous pixels. A ValueError is raised if the surface pixels are discontinuous. '2' returns a (surface-width, surface-height) array of raw pixels. The pixels are surface-bytesize-d unsigned integers. The pixel format is surface specific. The 3 byte unsigned integers of 24 bit surfaces are unlikely accepted by anything other than other pygame functions. '3' returns a (surface-width, surface-height, 3) array of RGB color components. Each of the red, green, and blue components are unsigned bytes. Only 24-bit and 32-bit surfaces are supported. The color components must be in either RGB or BGR order within the pixel. 'r' for red, 'g' for green, 'b' for blue, and 'a' for alpha return a (surface-width, surface-height) view of a single color component within a surface: a color plane. Color components are unsigned bytes. Both 24-bit and 32-bit surfaces support 'r', 'g', and 'b'. Only 32-bit surfaces with SRCALPHA support 'a'. The surface is locked only when an exposed interface is accessed. For new buffer interface accesses, the surface is unlocked once the last buffer view is released. For array interface and old buffer interface accesses, the surface remains locked until the BufferProxy object is released.  New in pygame 1.9.2.
get_width() 
 get the width of the Surface get_width() -> width  Return the width of the Surface in pixels.
lock() 
 lock the Surface memory for pixel access lock() -> None  Lock the pixel data of a Surface for access. On accelerated Surfaces, the pixel data may be stored in volatile video memory or nonlinear compressed forms. When a Surface is locked the pixel memory becomes available to access by regular software. Code that reads or writes pixel values will need the Surface to be locked. Surfaces should not remain locked for more than necessary. A locked Surface can often not be displayed or managed by pygame. Not all Surfaces require locking. The mustlock() method can determine if it is actually required. There is no performance penalty for locking and unlocking a Surface that does not need it. All pygame functions will automatically lock and unlock the Surface data as needed. If a section of code is going to make calls that will repeatedly lock and unlock the Surface many times, it can be helpful to wrap the block inside a lock and unlock pair. It is safe to nest locking and unlocking calls. The surface will only be unlocked after the final lock is released.
map_rgb() 
 convert a color into a mapped color value map_rgb(Color) -> mapped_int  Convert an RGBA color into the mapped integer value for this Surface. The returned integer will contain no more bits than the bit depth of the Surface. Mapped color values are not often used inside pygame, but can be passed to most functions that require a Surface and a color. See the Surface object documentation for more information about colors and pixel formats.
mustlock() 
 test if the Surface requires locking mustlock() -> bool  Returns True if the Surface is required to be locked to access pixel data. Usually pure software Surfaces do not require locking. This method is rarely needed, since it is safe and quickest to just lock all Surfaces as needed. All pygame functions will automatically lock and unlock the Surface data as needed. If a section of code is going to make calls that will repeatedly lock and unlock the Surface many times, it can be helpful to wrap the block inside a lock and unlock pair.
scroll() 
 Shift the surface image in place scroll(dx=0, dy=0) -> None  Move the image by dx pixels right and dy pixels down. dx and dy may be negative for left and up scrolls respectively. Areas of the surface that are not overwritten retain their original pixel values. Scrolling is contained by the Surface clip area. It is safe to have dx and dy values that exceed the surface size.  New in pygame 1.9.
set_alpha() 
 set the alpha value for the full Surface image set_alpha(value, flags=0) -> None set_alpha(None) -> None  Set the current alpha value for the Surface. When blitting this Surface onto a destination, the pixels will be drawn slightly transparent. The alpha value is an integer from 0 to 255, 0 is fully transparent and 255 is fully opaque. If None is passed for the alpha value, then alpha blending will be disabled, including per-pixel alpha. This value is different than the per pixel Surface alpha. For a surface with per pixel alpha, blanket alpha is ignored and None is returned.  Changed in pygame 2.0: per-surface alpha can be combined with per-pixel alpha.  The optional flags argument can be set to pygame.RLEACCEL to provide better performance on non accelerated displays. An RLEACCEL Surface will be slower to modify, but quicker to blit as a source.
set_at() 
 set the color value for a single pixel set_at((x, y), Color) -> None  Set the RGBA or mapped integer color value for a single pixel. If the Surface does not have per pixel alphas, the alpha value is ignored. Setting pixels outside the Surface area or outside the Surface clipping will have no effect. Getting and setting pixels one at a time is generally too slow to be used in a game or realtime situation. This function will temporarily lock and unlock the Surface as needed.
set_clip() 
 set the current clipping area of the Surface set_clip(rect) -> None set_clip(None) -> None  Each Surface has an active clipping area. This is a rectangle that represents the only pixels on the Surface that can be modified. If None is passed for the rectangle the full Surface will be available for changes. The clipping area is always restricted to the area of the Surface itself. If the clip rectangle is too large it will be shrunk to fit inside the Surface.
set_colorkey() 
 Set the transparent colorkey set_colorkey(Color, flags=0) -> None set_colorkey(None) -> None  Set the current color key for the Surface. When blitting this Surface onto a destination, any pixels that have the same color as the colorkey will be transparent. The color can be an RGB color or a mapped color integer. If None is passed, the colorkey will be unset. The colorkey will be ignored if the Surface is formatted to use per pixel alpha values. The colorkey can be mixed with the full Surface alpha value. The optional flags argument can be set to pygame.RLEACCEL to provide better performance on non accelerated displays. An RLEACCEL Surface will be slower to modify, but quicker to blit as a source.
set_masks() 
 set the bitmasks needed to convert between a color and a mapped integer set_masks((r,g,b,a)) -> None  This is not needed for normal pygame usage.  Note In SDL2, the masks are read-only and accordingly this method will raise an AttributeError if called.   New in pygame 1.8.1.
set_palette() 
 set the color palette for an 8-bit Surface set_palette([RGB, RGB, RGB, ...]) -> None  Set the full palette for an 8-bit Surface. This will replace the colors in the existing palette. A partial palette can be passed and only the first colors in the original palette will be changed. This function has no effect on a Surface with more than 8-bits per pixel.
set_palette_at() 
 set the color for a single index in an 8-bit Surface palette set_palette_at(index, RGB) -> None  Set the palette value for a single entry in a Surface palette. The index should be a value from 0 to 255. This function has no effect on a Surface with more than 8-bits per pixel.
set_shifts() 
 sets the bit shifts needed to convert between a color and a mapped integer set_shifts((r,g,b,a)) -> None  This is not needed for normal pygame usage.  Note In SDL2, the shifts are read-only and accordingly this method will raise an AttributeError if called.   New in pygame 1.8.1.
subsurface() 
 create a new surface that references its parent subsurface(Rect) -> Surface  Returns a new Surface that shares its pixels with its new parent. The new Surface is considered a child of the original. Modifications to either Surface pixels will effect each other. Surface information like clipping area and color keys are unique to each Surface. The new Surface will inherit the palette, color key, and alpha settings from its parent. It is possible to have any number of subsurfaces and subsubsurfaces on the parent. It is also possible to subsurface the display Surface if the display mode is not hardware accelerated. See get_offset() and get_parent() to learn more about the state of a subsurface. A subsurface will have the same class as the parent surface.
unlock() 
 unlock the Surface memory from pixel access unlock() -> None  Unlock the Surface pixel data after it has been locked. The unlocked Surface can once again be drawn and managed by pygame. See the lock() documentation for more details. All pygame functions will automatically lock and unlock the Surface data as needed. If a section of code is going to make calls that will repeatedly lock and unlock the Surface many times, it can be helpful to wrap the block inside a lock and unlock pair. It is safe to nest locking and unlocking calls. The surface will only be unlocked after the final lock is released.
unmap_rgb() 
 convert a mapped integer color value into a Color unmap_rgb(mapped_int) -> Color  Convert an mapped integer color into the RGB color components for this Surface. Mapped color values are not often used inside pygame, but can be passed to most functions that require a Surface and a color. See the Surface object documentation for more information about colors and pixel formats.
pygame.surfarray.array2d() 
 Copy pixels into a 2d array array2d(Surface) -> array  Copy the mapped (raw) pixels from a Surface into a 2D array. The bit depth of the surface will control the size of the integer values, and will work for any type of pixel format. This function will temporarily lock the Surface as pixels are copied (see the pygame.Surface.lock() - lock the Surface memory for pixel access method).
pygame.surfarray.array3d() 
 Copy pixels into a 3d array array3d(Surface) -> array  Copy the pixels from a Surface into a 3D array. The bit depth of the surface will control the size of the integer values, and will work for any type of pixel format. This function will temporarily lock the Surface as pixels are copied (see the pygame.Surface.lock() - lock the Surface memory for pixel access method).
pygame.surfarray.array_alpha() 
 Copy pixel alphas into a 2d array array_alpha(Surface) -> array  Copy the pixel alpha values (degree of transparency) from a Surface into a 2D array. This will work for any type of Surface format. Surfaces without a pixel alpha will return an array with all opaque values. This function will temporarily lock the Surface as pixels are copied (see the pygame.Surface.lock() - lock the Surface memory for pixel access method).
pygame.surfarray.array_colorkey() 
 Copy the colorkey values into a 2d array array_colorkey(Surface) -> array  Create a new array with the colorkey transparency value from each pixel. If the pixel matches the colorkey it will be fully transparent; otherwise it will be fully opaque. This will work on any type of Surface format. If the image has no colorkey a solid opaque array will be returned. This function will temporarily lock the Surface as pixels are copied.
pygame.surfarray.blit_array() 
 Blit directly from a array values blit_array(Surface, array) -> None  Directly copy values from an array into a Surface. This is faster than converting the array into a Surface and blitting. The array must be the same dimensions as the Surface and will completely replace all pixel values. Only integer, ASCII character and record arrays are accepted. This function will temporarily lock the Surface as the new values are copied.
pygame.surfarray.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.surfarray.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.surfarray.use_arraytype() () method. If no supported array system could be found, None will be returned.  New in pygame 1.8.
pygame.surfarray.make_surface() 
 Copy an array to a new surface make_surface(array) -> Surface  Create a new Surface that best resembles the data and format on the array. The array can be 2D or 3D with any sized integer values. Function make_surface uses the array struct interface to acquire array properties, so is not limited to just NumPy arrays. See pygame.pixelcopy. New in pygame 1.9.2: array struct interface support.
pygame.surfarray.map_array() 
 Map a 3d array into a 2d array map_array(Surface, array3d) -> array2d  Convert a 3D array into a 2D array. This will use the given Surface format to control the conversion. Palette surface formats are supported for NumPy arrays.
pygame.surfarray.pixels2d() 
 Reference pixels into a 2d array pixels2d(Surface) -> array  Create a new 2D array that directly references the pixel values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. Pixels from a 24-bit Surface cannot be referenced, but all other Surface bit depths can. The Surface this references will remain locked for the lifetime of the array (see the pygame.Surface.lock() - lock the Surface memory for pixel access method).
pygame.surfarray.pixels3d() 
 Reference pixels into a 3d array pixels3d(Surface) -> array  Create a new 3D array that directly references the pixel values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This will only work on Surfaces that have 24-bit or 32-bit formats. Lower pixel formats cannot be referenced. The Surface this references will remain locked for the lifetime of the array (see the pygame.Surface.lock() - lock the Surface memory for pixel access method).
pygame.surfarray.pixels_alpha() 
 Reference pixel alphas into a 2d array pixels_alpha(Surface) -> array  Create a new 2D array that directly references the alpha values (degree of transparency) in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This can only work on 32-bit Surfaces with a per-pixel alpha value. The Surface this array references will remain locked for the lifetime of the array.
pygame.surfarray.pixels_blue() 
 Reference pixel blue into a 2d array. pixels_blue (Surface) -> array  Create a new 2D array that directly references the blue values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This can only work on 24-bit or 32-bit Surfaces. The Surface this array references will remain locked for the lifetime of the array.
pygame.surfarray.pixels_green() 
 Reference pixel green into a 2d array. pixels_green (Surface) -> array  Create a new 2D array that directly references the green values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This can only work on 24-bit or 32-bit Surfaces. The Surface this array references will remain locked for the lifetime of the array.
pygame.surfarray.pixels_red() 
 Reference pixel red into a 2d array. pixels_red (Surface) -> array  Create a new 2D array that directly references the red values in a Surface. Any changes to the array will affect the pixels in the Surface. This is a fast operation since no data is copied. This can only work on 24-bit or 32-bit Surfaces. The Surface this array references will remain locked for the lifetime of the array.
pygame.surfarray.use_arraytype() 
 Sets the array system to be used for surface 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.tests.run() 
 Run the pygame unit test suite run(*args, **kwds) -> tuple  Positional arguments (optional): The names of tests to include. If omitted then all tests are run. Test names
need not include the trailing '_test'. Keyword arguments: incomplete - fail incomplete tests (default False)
nosubprocess - run all test suites in the current process
               (default False, use separate subprocesses)
dump - dump failures/errors as dict ready to eval (default False)
file - if provided, the name of a file into which to dump failures/errors
timings - if provided, the number of times to run each individual test to
          get an average run time (default is run each test once)
exclude - A list of TAG names to exclude from the run
show_output - show silenced stderr/stdout on errors (default False)
all - dump all results, not just errors (default False)
randomize - randomize order of tests (default False)
seed - if provided, a seed randomizer integer
multi_thread - if provided, the number of THREADS in which to run
               subprocessed tests
time_out - if subprocess is True then the time limit in seconds before
           killing a test (default 30)
fake - if provided, the name of the fake tests package in the
       run_tests__tests subpackage to run instead of the normal
       pygame tests
python - the path to a python executable to run subprocessed tests
         (default sys.executable) Return value: A tuple of total number of tests run, dictionary of error information.
The dictionary is empty if no errors were recorded. By default individual test modules are run in separate subprocesses. This recreates normal pygame usage where pygame.init() and pygame.quit() are called only once per program execution, and avoids unfortunate interactions between test modules. Also, a time limit is placed on test execution, so frozen tests are killed when there time allotment expired. Use the single process option if threading is not working properly or if tests are taking too long. It is not guaranteed that all tests will pass in single process mode. Tests are run in a randomized order if the randomize argument is True or a seed argument is provided. If no seed integer is provided then the system time is used. Individual test modules may have a __tags__ attribute, a list of tag strings used to selectively omit modules from a run. By default only 'interactive' modules such as cdrom_test are ignored. An interactive module must be run from the console as a Python program. This function can only be called once per Python session. It is not reentrant.
pygame.time.Clock 
 create an object to help track time Clock() -> Clock  Creates a new Clock object that can be used to track an amount of time. The clock also provides several functions to help control a game's framerate.   tick() 
 update the clock tick(framerate=0) -> milliseconds  This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. If you pass the optional framerate argument the function will delay to keep the game running slower than the given ticks per second. This can be used to help limit the runtime speed of a game. By calling Clock.tick(40) once per frame, the program will never run at more than 40 frames per second. Note that this function uses SDL_Delay function which is not accurate on every platform, but does not use much CPU. Use tick_busy_loop if you want an accurate timer, and don't mind chewing CPU. 
   tick_busy_loop() 
 update the clock tick_busy_loop(framerate=0) -> milliseconds  This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. If you pass the optional framerate argument the function will delay to keep the game running slower than the given ticks per second. This can be used to help limit the runtime speed of a game. By calling Clock.tick_busy_loop(40) once per frame, the program will never run at more than 40 frames per second. Note that this function uses pygame.time.delay(), which uses lots of CPU in a busy loop to make sure that timing is more accurate.  New in pygame 1.8.  
   get_time() 
 time used in the previous tick get_time() -> milliseconds  The number of milliseconds that passed between the previous two calls to Clock.tick(). 
   get_rawtime() 
 actual time used in the previous tick get_rawtime() -> milliseconds  Similar to Clock.get_time(), but does not include any time used while Clock.tick() was delaying to limit the framerate. 
   get_fps() 
 compute the clock framerate get_fps() -> float  Compute your game's framerate (in frames per second). It is computed by averaging the last ten calls to Clock.tick().
get_fps() 
 compute the clock framerate get_fps() -> float  Compute your game's framerate (in frames per second). It is computed by averaging the last ten calls to Clock.tick().
get_rawtime() 
 actual time used in the previous tick get_rawtime() -> milliseconds  Similar to Clock.get_time(), but does not include any time used while Clock.tick() was delaying to limit the framerate.
get_time() 
 time used in the previous tick get_time() -> milliseconds  The number of milliseconds that passed between the previous two calls to Clock.tick().
tick() 
 update the clock tick(framerate=0) -> milliseconds  This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. If you pass the optional framerate argument the function will delay to keep the game running slower than the given ticks per second. This can be used to help limit the runtime speed of a game. By calling Clock.tick(40) once per frame, the program will never run at more than 40 frames per second. Note that this function uses SDL_Delay function which is not accurate on every platform, but does not use much CPU. Use tick_busy_loop if you want an accurate timer, and don't mind chewing CPU.
tick_busy_loop() 
 update the clock tick_busy_loop(framerate=0) -> milliseconds  This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. If you pass the optional framerate argument the function will delay to keep the game running slower than the given ticks per second. This can be used to help limit the runtime speed of a game. By calling Clock.tick_busy_loop(40) once per frame, the program will never run at more than 40 frames per second. Note that this function uses pygame.time.delay(), which uses lots of CPU in a busy loop to make sure that timing is more accurate.  New in pygame 1.8.
pygame.time.delay() 
 pause the program for an amount of time delay(milliseconds) -> time  Will pause for a given number of milliseconds. This function will use the processor (rather than sleeping) in order to make the delay more accurate than pygame.time.wait(). This returns the actual number of milliseconds used.
pygame.time.get_ticks() 
 get the time in milliseconds get_ticks() -> milliseconds  Return the number of milliseconds since pygame.init() was called. Before pygame is initialized this will always be 0.