neulab/docprompting-conala huggingface dataset:
Permuted Congruential Generator (64-bit, PCG64)   class numpy.random.PCG64(seed=None)
 
BitGenerator for the PCG-64 pseudo-random number generator.  Parameters 
 
seed{None, int, array_like[ints], SeedSequence}, optional


A seed to initialize the BitGenerator. If None, then fresh, unpredictable entropy will be pulled from the OS. If an int or array_like[ints] is passed, then it will be passed to SeedSequence to derive the initial BitGenerator state. One may also pass in a SeedSequence instance.     Notes PCG-64 is a 128-bit implementation of O’Neill’s permutation congruential generator ([1], [2]). PCG-64 has a period of \(2^{128}\) and supports advancing an arbitrary number of steps as well as \(2^{127}\) streams. The specific member of the PCG family that we use is PCG XSL RR 128/64 as described in the paper ([2]). PCG64 provides a capsule containing function pointers that produce doubles, and unsigned 32 and 64- bit integers. These are not directly consumable in Python and must be consumed by a Generator or similar object that supports low-level access. Supports the method advance to advance the RNG an arbitrary number of steps. The state of the PCG-64 RNG is represented by 2 128-bit unsigned integers. State and Seeding The PCG64 state vector consists of 2 unsigned 128-bit values, which are represented externally as Python ints. One is the state of the PRNG, which is advanced by a linear congruential generator (LCG). The second is a fixed odd increment used in the LCG. The input seed is processed by SeedSequence to generate both values. The increment is not independently settable. Parallel Features The preferred way to use a BitGenerator in parallel applications is to use the SeedSequence.spawn method to obtain entropy values, and to use these to generate new BitGenerators: >>> from numpy.random import Generator, PCG64, SeedSequence
>>> sg = SeedSequence(1234)
>>> rg = [Generator(PCG64(s)) for s in sg.spawn(10)]
 Compatibility Guarantee PCG64 makes a guarantee that a fixed seed will always produce the same random integer stream. References  1 
“PCG, A Family of Better Random Number Generators”  
2(1,2)
 
O’Neill, Melissa E. “PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation”   
  State  
state Get or set the PRNG state     Parallel generation  
advance(delta) Advance the underlying RNG as-if delta draws have occurred.  
jumped([jumps]) Returns a new bit generator with the state jumped.     Extending  
cffi CFFI interface  
ctypes ctypes interface
Permuted Congruential Generator (64-bit, PCG64 DXSM)   class numpy.random.PCG64DXSM(seed=None)
 
BitGenerator for the PCG-64 DXSM pseudo-random number generator.  Parameters 
 
seed{None, int, array_like[ints], SeedSequence}, optional


A seed to initialize the BitGenerator. If None, then fresh, unpredictable entropy will be pulled from the OS. If an int or array_like[ints] is passed, then it will be passed to SeedSequence to derive the initial BitGenerator state. One may also pass in a SeedSequence instance.     Notes PCG-64 DXSM is a 128-bit implementation of O’Neill’s permutation congruential generator ([1], [2]). PCG-64 DXSM has a period of \(2^{128}\) and supports advancing an arbitrary number of steps as well as \(2^{127}\) streams. The specific member of the PCG family that we use is PCG CM DXSM 128/64. It differs from PCG64 in that it uses the stronger DXSM output function, a 64-bit “cheap multiplier” in the LCG, and outputs from the state before advancing it rather than advance-then-output. PCG64DXSM provides a capsule containing function pointers that produce doubles, and unsigned 32 and 64- bit integers. These are not directly consumable in Python and must be consumed by a Generator or similar object that supports low-level access. Supports the method advance to advance the RNG an arbitrary number of steps. The state of the PCG-64 DXSM RNG is represented by 2 128-bit unsigned integers. State and Seeding The PCG64DXSM state vector consists of 2 unsigned 128-bit values, which are represented externally as Python ints. One is the state of the PRNG, which is advanced by a linear congruential generator (LCG). The second is a fixed odd increment used in the LCG. The input seed is processed by SeedSequence to generate both values. The increment is not independently settable. Parallel Features The preferred way to use a BitGenerator in parallel applications is to use the SeedSequence.spawn method to obtain entropy values, and to use these to generate new BitGenerators: >>> from numpy.random import Generator, PCG64DXSM, SeedSequence
>>> sg = SeedSequence(1234)
>>> rg = [Generator(PCG64DXSM(s)) for s in sg.spawn(10)]
 Compatibility Guarantee PCG64DXSM makes a guarantee that a fixed seed will always produce the same random integer stream. References  1 
“PCG, A Family of Better Random Number Generators”  2 
O’Neill, Melissa E. “PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation”   
  State  
state Get or set the PRNG state     Parallel generation  
advance(delta) Advance the underlying RNG as-if delta draws have occurred.  
jumped([jumps]) Returns a new bit generator with the state jumped.     Extending  
cffi CFFI interface  
ctypes ctypes interface
numpy.random.SeedSequence   class numpy.random.SeedSequence(entropy=None, *, spawn_key=(), pool_size=4)
 
SeedSequence mixes sources of entropy in a reproducible way to set the initial state for independent and very probably non-overlapping BitGenerators. Once the SeedSequence is instantiated, you can call the generate_state method to get an appropriately sized seed. Calling spawn(n) will create n SeedSequences that can be used to seed independent BitGenerators, i.e. for different threads.  Parameters 
 
entropy{None, int, sequence[int]}, optional


The entropy for creating a SeedSequence.  
spawn_key{(), sequence[int]}, optional


A third source of entropy, used internally when calling SeedSequence.spawn  
pool_size{int}, optional


Size of the pooled entropy to store. Default is 4 to give a 128-bit entropy pool. 8 (for 256 bits) is another reasonable choice if working with larger PRNGs, but there is very little to be gained by selecting another value.  
n_children_spawned{int}, optional


The number of children already spawned. Only pass this if reconstructing a SeedSequence from a serialized form.     Notes Best practice for achieving reproducible bit streams is to use the default None for the initial entropy, and then use SeedSequence.entropy to log/pickle the entropy for reproducibility: >>> sq1 = np.random.SeedSequence()
>>> sq1.entropy
243799254704924441050048792905230269161  # random
>>> sq2 = np.random.SeedSequence(sq1.entropy)
>>> np.all(sq1.generate_state(10) == sq2.generate_state(10))
True
  Attributes 
 entropy
n_children_spawned
pool
pool_size
spawn_key
state
   Methods  
generate_state(n_words[, dtype]) Return the requested number of words for PRNG seeding.  
spawn(n_children) Spawn a number of child SeedSequence s by extending the spawn_key.
SFC64 Small Fast Chaotic PRNG   class numpy.random.SFC64(seed=None)
 
BitGenerator for Chris Doty-Humphrey’s Small Fast Chaotic PRNG.  Parameters 
 
seed{None, int, array_like[ints], SeedSequence}, optional


A seed to initialize the BitGenerator. If None, then fresh, unpredictable entropy will be pulled from the OS. If an int or array_like[ints] is passed, then it will be passed to SeedSequence to derive the initial BitGenerator state. One may also pass in a SeedSequence instance.     Notes SFC64 is a 256-bit implementation of Chris Doty-Humphrey’s Small Fast Chaotic PRNG ([1]). SFC64 has a few different cycles that one might be on, depending on the seed; the expected period will be about \(2^{255}\) ([2]). SFC64 incorporates a 64-bit counter which means that the absolute minimum cycle length is \(2^{64}\) and that distinct seeds will not run into each other for at least \(2^{64}\) iterations. SFC64 provides a capsule containing function pointers that produce doubles, and unsigned 32 and 64- bit integers. These are not directly consumable in Python and must be consumed by a Generator or similar object that supports low-level access. State and Seeding The SFC64 state vector consists of 4 unsigned 64-bit values. The last is a 64-bit counter that increments by 1 each iteration. The input seed is processed by SeedSequence to generate the first 3 values, then the SFC64 algorithm is iterated a small number of times to mix. Compatibility Guarantee SFC64 makes a guarantee that a fixed seed will always produce the same random integer stream. References  1 
“PractRand”  2 
“Random Invertible Mapping Statistics”   
  State  
state Get or set the PRNG state     Extending  
cffi CFFI interface  
ctypes ctypes interface
numpy.RankWarning   exception numpy.RankWarning[source]
 
Issued by polyfit when the Vandermonde matrix is rank deficient. For more information, a way to suppress the warning, and an example of RankWarning being issued, see polyfit.
numpy.ravel   numpy.ravel(a, order='C')[source]
 
Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned for a masked array input)  Parameters 
 
aarray_like


Input array. The elements in a are read in the order specified by order, and packed as a 1-D array.  
order{‘C’,’F’, ‘A’, ‘K’}, optional


The elements of a are read using this index order. ‘C’ means to index the elements in row-major, C-style order, with the last axis index changing fastest, back to the first axis index changing slowest. ‘F’ means to index the elements in column-major, Fortran-style order, with the first index changing fastest, and the last index changing slowest. Note that the ‘C’ and ‘F’ options take no account of the memory layout of the underlying array, and only refer to the order of axis indexing. ‘A’ means to read the elements in Fortran-like index order if a is Fortran contiguous in memory, C-like order otherwise. ‘K’ means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, ‘C’ index order is used.    Returns 
 
yarray_like


y is an array of the same subtype as a, with shape (a.size,). Note that matrices are special cased for backward compatibility, if a is a matrix, then y is a 1-D ndarray.      See also  ndarray.flat

1-D iterator over an array.  ndarray.flatten

1-D array copy of the elements of an array in row-major order.  ndarray.reshape

Change the shape of an array without changing its data.    Notes In row-major, C-style order, in two dimensions, the row index varies the slowest, and the column index the quickest. This can be generalized to multiple dimensions, where row-major order implies that the index along the first axis varies slowest, and the index along the last quickest. The opposite holds for column-major, Fortran-style index ordering. When a view is desired in as many cases as possible, arr.reshape(-1) may be preferable. Examples It is equivalent to reshape(-1, order=order). >>> x = np.array([[1, 2, 3], [4, 5, 6]])
>>> np.ravel(x)
array([1, 2, 3, 4, 5, 6])
 >>> x.reshape(-1)
array([1, 2, 3, 4, 5, 6])
 >>> np.ravel(x, order='F')
array([1, 4, 2, 5, 3, 6])
 When order is ‘A’, it will preserve the array’s ‘C’ or ‘F’ ordering: >>> np.ravel(x.T)
array([1, 4, 2, 5, 3, 6])
>>> np.ravel(x.T, order='A')
array([1, 2, 3, 4, 5, 6])
 When order is ‘K’, it will preserve orderings that are neither ‘C’ nor ‘F’, but won’t reverse axes: >>> a = np.arange(3)[::-1]; a
array([2, 1, 0])
>>> a.ravel(order='C')
array([2, 1, 0])
>>> a.ravel(order='K')
array([2, 1, 0])
 >>> a = np.arange(12).reshape(2,3,2).swapaxes(1,2); a
array([[[ 0,  2,  4],
        [ 1,  3,  5]],
       [[ 6,  8, 10],
        [ 7,  9, 11]]])
>>> a.ravel(order='C')
array([ 0,  2,  4,  1,  3,  5,  6,  8, 10,  7,  9, 11])
>>> a.ravel(order='K')
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])
numpy.ravel_multi_index   numpy.ravel_multi_index(multi_index, dims, mode='raise', order='C')
 
Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index.  Parameters 
 
multi_indextuple of array_like


A tuple of integer arrays, one array for each dimension.  
dimstuple of ints


The shape of array into which the indices from multi_index apply.  
mode{‘raise’, ‘wrap’, ‘clip’}, optional


Specifies how out-of-bounds indices are handled. Can specify either one mode or a tuple of modes, one mode per index.  ‘raise’ – raise an error (default) ‘wrap’ – wrap around ‘clip’ – clip to the range  In ‘clip’ mode, a negative index which would normally wrap will clip to 0 instead.  
order{‘C’, ‘F’}, optional


Determines whether the multi-index should be viewed as indexing in row-major (C-style) or column-major (Fortran-style) order.    Returns 
 
raveled_indicesndarray


An array of indices into the flattened version of an array of dimensions dims.      See also  unravel_index
  Notes  New in version 1.6.0.  Examples >>> arr = np.array([[3,6,6],[4,5,1]])
>>> np.ravel_multi_index(arr, (7,6))
array([22, 41, 37])
>>> np.ravel_multi_index(arr, (7,6), order='F')
array([31, 41, 13])
>>> np.ravel_multi_index(arr, (4,6), mode='clip')
array([22, 23, 19])
>>> np.ravel_multi_index(arr, (4,4), mode=('clip','wrap'))
array([12, 13, 13])
 >>> np.ravel_multi_index((3,1,4,1), (6,7,8,9))
1621
numpy.real   numpy.real(val)[source]
 
Return the real part of the complex argument.  Parameters 
 
valarray_like


Input array.    Returns 
 
outndarray or scalar


The real component of the complex argument. If val is real, the type of val is used for the output. If val has complex elements, the returned type is float.      See also  
real_if_close, imag, angle

  Examples >>> a = np.array([1+2j, 3+4j, 5+6j])
>>> a.real
array([1.,  3.,  5.])
>>> a.real = 9
>>> a
array([9.+2.j,  9.+4.j,  9.+6.j])
>>> a.real = np.array([9, 8, 7])
>>> a
array([9.+2.j,  8.+4.j,  7.+6.j])
>>> np.real(1 + 1j)
1.0
numpy.real_if_close   numpy.real_if_close(a, tol=100)[source]
 
If input is complex with all imaginary parts close to zero, return real parts. “Close to zero” is defined as tol * (machine epsilon of the type for a).  Parameters 
 
aarray_like


Input array.  
tolfloat


Tolerance in machine epsilons for the complex part of the elements in the array.    Returns 
 
outndarray


If a is real, the type of a is used for the output. If a has complex elements, the returned type is float.      See also  
real, imag, angle

  Notes Machine epsilon varies from machine to machine and between data types but Python floats on most platforms have a machine epsilon equal to 2.2204460492503131e-16. You can use ‘np.finfo(float).eps’ to print out the machine epsilon for floats. Examples >>> np.finfo(float).eps
2.2204460492503131e-16 # may vary
 >>> np.real_if_close([2.1 + 4e-14j, 5.2 + 3e-15j], tol=1000)
array([2.1, 5.2])
>>> np.real_if_close([2.1 + 4e-13j, 5.2 + 3e-15j], tol=1000)
array([2.1+4.e-13j, 5.2 + 3e-15j])
numpy.reciprocal   numpy.reciprocal(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'reciprocal'>
 
Return the reciprocal of the argument, element-wise. Calculates 1/x.  Parameters 
 
xarray_like


Input array.  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
yndarray


Return array. This is a scalar if x is a scalar.     Notes  Note This function is not designed to work with integers.  For integer arguments with absolute value larger than 1 the result is always zero because of the way Python handles integer division. For integer zero the result is an overflow. Examples >>> np.reciprocal(2.)
0.5
>>> np.reciprocal([1, 2., 3.33])
array([ 1.       ,  0.5      ,  0.3003003])
numpy.remainder   numpy.remainder(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'remainder'>
 
Returns the element-wise remainder of division. Computes the remainder complementary to the floor_divide function. It is equivalent to the Python modulus operator``x1 % x2`` and has the same sign as the divisor x2. The MATLAB function equivalent to np.remainder is mod.  Warning This should not be confused with:  Python 3.7’s math.remainder and C’s remainder, which computes the IEEE remainder, which are the complement to round(x1 / x2). The MATLAB rem function and or the C % operator which is the complement to int(x1 / x2).    Parameters 
 
x1array_like


Dividend array.  
x2array_like


Divisor array. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).  
outndarray, None, or tuple of ndarray and None, optional


A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.  
wherearray_like, optional


This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.  **kwargs

For other keyword-only arguments, see the ufunc docs.    Returns 
 
yndarray


The element-wise remainder of the quotient floor_divide(x1, x2). This is a scalar if both x1 and x2 are scalars.      See also  floor_divide

Equivalent of Python // operator.  divmod

Simultaneous floor division and remainder.  fmod

Equivalent of the MATLAB rem function.  
divide, floor

  Notes Returns 0 when x2 is 0 and both x1 and x2 are (arrays of) integers. mod is an alias of remainder. Examples >>> np.remainder([4, 7], [2, 3])
array([0, 1])
>>> np.remainder(np.arange(7), 5)
array([0, 1, 2, 3, 4, 0, 1])
 The % operator can be used as a shorthand for np.remainder on ndarrays. >>> x1 = np.arange(7)
>>> x1 % 5
array([0, 1, 2, 3, 4, 0, 1])
numpy.repeat   numpy.repeat(a, repeats, axis=None)[source]
 
Repeat elements of an array.  Parameters 
 
aarray_like


Input array.  
repeatsint or array of ints


The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis.  
axisint, optional


The axis along which to repeat values. By default, use the flattened input array, and return a flat output array.    Returns 
 
repeated_arrayndarray


Output array which has the same shape as a, except along the given axis.      See also  tile

Tile an array.  unique

Find the unique elements of an array.    Examples >>> np.repeat(3, 4)
array([3, 3, 3, 3])
>>> x = np.array([[1,2],[3,4]])
>>> np.repeat(x, 2)
array([1, 1, 2, 2, 3, 3, 4, 4])
>>> np.repeat(x, 3, axis=1)
array([[1, 1, 1, 2, 2, 2],
       [3, 3, 3, 4, 4, 4]])
>>> np.repeat(x, [1, 2], axis=0)
array([[1, 2],
       [3, 4],
       [3, 4]])
numpy.require   numpy.require(a, dtype=None, requirements=None, *, like=None)[source]
 
Return an ndarray of the provided type that satisfies requirements. This function is useful to be sure that an array with the correct flags is returned for passing to compiled code (perhaps through ctypes).  Parameters 
 
aarray_like


The object to be converted to a type-and-requirement-satisfying array.  
dtypedata-type


The required data-type. If None preserve the current dtype. If your application requires the data to be in native byteorder, include a byteorder specification as a part of the dtype specification.  
requirementsstr or list of str


The requirements list can be any of the following  ‘F_CONTIGUOUS’ (‘F’) - ensure a Fortran-contiguous array ‘C_CONTIGUOUS’ (‘C’) - ensure a C-contiguous array ‘ALIGNED’ (‘A’) - ensure a data-type aligned array ‘WRITEABLE’ (‘W’) - ensure a writable array ‘OWNDATA’ (‘O’) - ensure an array that owns its own data ‘ENSUREARRAY’, (‘E’) - ensure a base array, instead of a subclass   
likearray_like


Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it. In this case, it ensures the creation of an array object compatible with that passed in via this argument.  New in version 1.20.0.     Returns 
 
outndarray


Array with specified requirements and type if given.      See also  asarray

Convert input to an ndarray.  asanyarray

Convert to an ndarray, but pass through ndarray subclasses.  ascontiguousarray

Convert input to a contiguous array.  asfortranarray

Convert input to an ndarray with column-major memory order.  ndarray.flags

Information about the memory layout of the array.    Notes The returned array will be guaranteed to have the listed requirements by making a copy if needed. Examples >>> x = np.arange(6).reshape(2,3)
>>> x.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False
 >>> y = np.require(x, dtype=np.float32, requirements=['A', 'O', 'W', 'F'])
>>> y.flags
  C_CONTIGUOUS : False
  F_CONTIGUOUS : True
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False