neulab/docprompting-conala huggingface dataset:
is_subnormal(x)  
Returns True if x is subnormal; otherwise returns False.
logb(x)  
Returns the exponent of the magnitude of the operand’s MSD.
logical_and(x, y)  
Applies the logical operation and between each operand’s digits.
logical_or(x, y)  
Applies the logical operation or between each operand’s digits.
logical_xor(x, y)  
Applies the logical operation xor between each operand’s digits.
max_mag(x, y)  
Compares the values numerically with their sign ignored.
min_mag(x, y)  
Compares the values numerically with their sign ignored.
next_toward(x, y)  
Returns the number closest to x, in direction towards y.
plus(x)  
Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is not an identity operation.
power(x, y, modulo=None)  
Return x to the power of y, reduced modulo modulo if given. With two arguments, compute x**y. If x is negative then y must be integral. The result will be inexact unless y is integral and the result is finite and can be expressed exactly in ‘precision’ digits. The rounding mode of the context is used. Results are always correctly-rounded in the Python version. Decimal(0) ** Decimal(0) results in InvalidOperation, and if InvalidOperation is not trapped, then results in Decimal('NaN').  Changed in version 3.3: The C module computes power() in terms of the correctly-rounded exp() and ln() functions. The result is well-defined but only “almost always correctly-rounded”.  With three arguments, compute (x**y) % modulo. For the three argument form, the following restrictions on the arguments hold:  all three arguments must be integral 
y must be nonnegative at least one of x or y must be nonzero 
modulo must be nonzero and have at most ‘precision’ digits  The value resulting from Context.power(x, y, modulo) is equal to the value that would be obtained by computing (x**y)
% modulo with unbounded precision, but is computed more efficiently. The exponent of the result is zero, regardless of the exponents of x, y and modulo. The result is always exact.
quantize(x, y)  
Returns a value equal to x (rounded), having the exponent of y.
remainder(x, y)  
Returns the remainder from integer division. The sign of the result, if non-zero, is the same as that of the original dividend.
remainder_near(x, y)  
Returns x - y * n, where n is the integer nearest the exact value of x / y (if the result is 0 then its sign will be the sign of x).
same_quantum(x, y)  
Returns True if the two operands have the same exponent.
scaleb(x, y)  
Returns the first operand after adding the second value its exp.
to_eng_string(x)  
Convert to a string, using engineering notation if an exponent is needed. Engineering notation has an exponent which is a multiple of 3. This can leave up to 3 digits to the left of the decimal place and may require the addition of either one or two trailing zeros.
to_sci_string(x)  
Converts a number to a string using scientific notation.
adjusted()  
Return the adjusted exponent after shifting out the coefficient’s rightmost digits until only the lead digit remains: Decimal('321e+5').adjusted() returns seven. Used for determining the position of the most significant digit with respect to the decimal point.
as_integer_ratio()  
Return a pair (n, d) of integers that represent the given Decimal instance as a fraction, in lowest terms and with a positive denominator: >>> Decimal('-3.14').as_integer_ratio()
(-157, 50)
 The conversion is exact. Raise OverflowError on infinities and ValueError on NaNs.
as_tuple()  
Return a named tuple representation of the number: DecimalTuple(sign, digits, exponent).
canonical()  
Return the canonical encoding of the argument. Currently, the encoding of a Decimal instance is always canonical, so this operation returns its argument unchanged.
compare(other, context=None)  
Compare the values of two Decimal instances. compare() returns a Decimal instance, and if either operand is a NaN then the result is a NaN: a or b is a NaN  ==> Decimal('NaN')
a < b            ==> Decimal('-1')
a == b           ==> Decimal('0')
a > b            ==> Decimal('1')
compare_signal(other, context=None)  
This operation is identical to the compare() method, except that all NaNs signal. That is, if neither operand is a signaling NaN then any quiet NaN operand is treated as though it were a signaling NaN.
compare_total(other, context=None)  
Compare two operands using their abstract representation rather than their numerical value. Similar to the compare() method, but the result gives a total ordering on Decimal instances. Two Decimal instances with the same numeric value but different representations compare unequal in this ordering: >>> Decimal('12.0').compare_total(Decimal('12'))
Decimal('-1')
 Quiet and signaling NaNs are also included in the total ordering. The result of this function is Decimal('0') if both operands have the same representation, Decimal('-1') if the first operand is lower in the total order than the second, and Decimal('1') if the first operand is higher in the total order than the second operand. See the specification for details of the total order. This operation is unaffected by context and is quiet: no flags are changed and no rounding is performed. As an exception, the C version may raise InvalidOperation if the second operand cannot be converted exactly.
compare_total_mag(other, context=None)  
Compare two operands using their abstract representation rather than their value as in compare_total(), but ignoring the sign of each operand. x.compare_total_mag(y) is equivalent to x.copy_abs().compare_total(y.copy_abs()). This operation is unaffected by context and is quiet: no flags are changed and no rounding is performed. As an exception, the C version may raise InvalidOperation if the second operand cannot be converted exactly.
conjugate()  
Just returns self, this method is only to comply with the Decimal Specification.
copy_abs()  
Return the absolute value of the argument. This operation is unaffected by the context and is quiet: no flags are changed and no rounding is performed.
copy_negate()  
Return the negation of the argument. This operation is unaffected by the context and is quiet: no flags are changed and no rounding is performed.
copy_sign(other, context=None)  
Return a copy of the first operand with the sign set to be the same as the sign of the second operand. For example: >>> Decimal('2.3').copy_sign(Decimal('-1.5'))
Decimal('-2.3')
 This operation is unaffected by context and is quiet: no flags are changed and no rounding is performed. As an exception, the C version may raise InvalidOperation if the second operand cannot be converted exactly.
exp(context=None)  
Return the value of the (natural) exponential function e**x at the given number. The result is correctly rounded using the ROUND_HALF_EVEN rounding mode. >>> Decimal(1).exp()
Decimal('2.718281828459045235360287471')
>>> Decimal(321).exp()
Decimal('2.561702493119680037517373933E+139')
fma(other, third, context=None)  
Fused multiply-add. Return self*other+third with no rounding of the intermediate product self*other. >>> Decimal(2).fma(3, 5)
Decimal('11')
from_float(f)  
Classmethod that converts a float to a decimal number, exactly. Note Decimal.from_float(0.1) is not the same as Decimal(‘0.1’). Since 0.1 is not exactly representable in binary floating point, the value is stored as the nearest representable value which is 0x1.999999999999ap-4. That equivalent value in decimal is 0.1000000000000000055511151231257827021181583404541015625.  Note From Python 3.2 onwards, a Decimal instance can also be constructed directly from a float.  >>> Decimal.from_float(0.1)
Decimal('0.1000000000000000055511151231257827021181583404541015625')
>>> Decimal.from_float(float('nan'))
Decimal('NaN')
>>> Decimal.from_float(float('inf'))
Decimal('Infinity')
>>> Decimal.from_float(float('-inf'))
Decimal('-Infinity')
  New in version 3.1.
is_canonical()  
Return True if the argument is canonical and False otherwise. Currently, a Decimal instance is always canonical, so this operation always returns True.
is_finite()  
Return True if the argument is a finite number, and False if the argument is an infinity or a NaN.
is_infinite()  
Return True if the argument is either positive or negative infinity and False otherwise.
is_nan()  
Return True if the argument is a (quiet or signaling) NaN and False otherwise.
is_normal(context=None)  
Return True if the argument is a normal finite number. Return False if the argument is zero, subnormal, infinite or a NaN.
is_qnan()  
Return True if the argument is a quiet NaN, and False otherwise.
is_signed()  
Return True if the argument has a negative sign and False otherwise. Note that zeros and NaNs can both carry signs.
is_snan()  
Return True if the argument is a signaling NaN and False otherwise.
is_subnormal(context=None)  
Return True if the argument is subnormal, and False otherwise.
is_zero()  
Return True if the argument is a (positive or negative) zero and False otherwise.
ln(context=None)  
Return the natural (base e) logarithm of the operand. The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.
log10(context=None)  
Return the base ten logarithm of the operand. The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.
logb(context=None)  
For a nonzero number, return the adjusted exponent of its operand as a Decimal instance. If the operand is a zero then Decimal('-Infinity') is returned and the DivisionByZero flag is raised. If the operand is an infinity then Decimal('Infinity') is returned.
logical_and(other, context=None)  
logical_and() is a logical operation which takes two logical operands (see Logical operands). The result is the digit-wise and of the two operands.
logical_invert(context=None)  
logical_invert() is a logical operation. The result is the digit-wise inversion of the operand.
logical_or(other, context=None)  
logical_or() is a logical operation which takes two logical operands (see Logical operands). The result is the digit-wise or of the two operands.
logical_xor(other, context=None)  
logical_xor() is a logical operation which takes two logical operands (see Logical operands). The result is the digit-wise exclusive or of the two operands.
max(other, context=None)  
Like max(self, other) except that the context rounding rule is applied before returning and that NaN values are either signaled or ignored (depending on the context and whether they are signaling or quiet).
max_mag(other, context=None)  
Similar to the max() method, but the comparison is done using the absolute values of the operands.
min(other, context=None)  
Like min(self, other) except that the context rounding rule is applied before returning and that NaN values are either signaled or ignored (depending on the context and whether they are signaling or quiet).
min_mag(other, context=None)  
Similar to the min() method, but the comparison is done using the absolute values of the operands.
next_minus(context=None)  
Return the largest number representable in the given context (or in the current thread’s context if no context is given) that is smaller than the given operand.
next_plus(context=None)  
Return the smallest number representable in the given context (or in the current thread’s context if no context is given) that is larger than the given operand.
next_toward(other, context=None)  
If the two operands are unequal, return the number closest to the first operand in the direction of the second operand. If both operands are numerically equal, return a copy of the first operand with the sign set to be the same as the sign of the second operand.
normalize(context=None)  
Normalize the number by stripping the rightmost trailing zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used for producing canonical values for attributes of an equivalence class. For example, Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent value Decimal('32.1').
number_class(context=None)  
Return a string describing the class of the operand. The returned value is one of the following ten strings.  
"-Infinity", indicating that the operand is negative infinity. 
"-Normal", indicating that the operand is a negative normal number. 
"-Subnormal", indicating that the operand is negative and subnormal. 
"-Zero", indicating that the operand is a negative zero. 
"+Zero", indicating that the operand is a positive zero. 
"+Subnormal", indicating that the operand is positive and subnormal. 
"+Normal", indicating that the operand is a positive normal number. 
"+Infinity", indicating that the operand is positive infinity. 
"NaN", indicating that the operand is a quiet NaN (Not a Number). 
"sNaN", indicating that the operand is a signaling NaN.
quantize(exp, rounding=None, context=None)  
Return a value equal to the first operand after rounding and having the exponent of the second operand. >>> Decimal('1.41421356').quantize(Decimal('1.000'))
Decimal('1.414')
 Unlike other operations, if the length of the coefficient after the quantize operation would be greater than precision, then an InvalidOperation is signaled. This guarantees that, unless there is an error condition, the quantized exponent is always equal to that of the right-hand operand. Also unlike other operations, quantize never signals Underflow, even if the result is subnormal and inexact. If the exponent of the second operand is larger than that of the first then rounding may be necessary. In this case, the rounding mode is determined by the rounding argument if given, else by the given context argument; if neither argument is given the rounding mode of the current thread’s context is used. An error is returned whenever the resulting exponent is greater than Emax or less than Etiny.
radix()  
Return Decimal(10), the radix (base) in which the Decimal class does all its arithmetic. Included for compatibility with the specification.
remainder_near(other, context=None)  
Return the remainder from dividing self by other. This differs from self % other in that the sign of the remainder is chosen so as to minimize its absolute value. More precisely, the return value is self - n * other where n is the integer nearest to the exact value of self / other, and if two integers are equally near then the even one is chosen. If the result is zero then its sign will be the sign of self. >>> Decimal(18).remainder_near(Decimal(10))
Decimal('-2')
>>> Decimal(25).remainder_near(Decimal(10))
Decimal('5')
>>> Decimal(35).remainder_near(Decimal(10))
Decimal('-5')
rotate(other, context=None)  
Return the result of rotating the digits of the first operand by an amount specified by the second operand. The second operand must be an integer in the range -precision through precision. The absolute value of the second operand gives the number of places to rotate. If the second operand is positive then rotation is to the left; otherwise rotation is to the right. The coefficient of the first operand is padded on the left with zeros to length precision if necessary. The sign and exponent of the first operand are unchanged.
same_quantum(other, context=None)  
Test whether self and other have the same exponent or whether both are NaN. This operation is unaffected by context and is quiet: no flags are changed and no rounding is performed. As an exception, the C version may raise InvalidOperation if the second operand cannot be converted exactly.
scaleb(other, context=None)  
Return the first operand with exponent adjusted by the second. Equivalently, return the first operand multiplied by 10**other. The second operand must be an integer.
shift(other, context=None)  
Return the result of shifting the digits of the first operand by an amount specified by the second operand. The second operand must be an integer in the range -precision through precision. The absolute value of the second operand gives the number of places to shift. If the second operand is positive then the shift is to the left; otherwise the shift is to the right. Digits shifted into the coefficient are zeros. The sign and exponent of the first operand are unchanged.
to_eng_string(context=None)  
Convert to a string, using engineering notation if an exponent is needed. Engineering notation has an exponent which is a multiple of 3. This can leave up to 3 digits to the left of the decimal place and may require the addition of either one or two trailing zeros. For example, this converts Decimal('123E+1') to Decimal('1.23E+3').
to_integral(rounding=None, context=None)  
Identical to the to_integral_value() method. The to_integral name has been kept for compatibility with older versions.
to_integral_exact(rounding=None, context=None)  
Round to the nearest integer, signaling Inexact or Rounded as appropriate if rounding occurs. The rounding mode is determined by the rounding parameter if given, else by the given context. If neither parameter is given then the rounding mode of the current context is used.
to_integral_value(rounding=None, context=None)  
Round to the nearest integer without signaling Inexact or Rounded. If given, applies rounding; otherwise, uses the rounding method in either the supplied context or the current context.
class decimal.DecimalException  
Base class for other signals and a subclass of ArithmeticError.
class decimal.DefaultContext  
This context is used by the Context constructor as a prototype for new contexts. Changing a field (such a precision) has the effect of changing the default for new contexts created by the Context constructor. This context is most useful in multi-threaded environments. Changing one of the fields before threads are started has the effect of setting system-wide defaults. Changing the fields after threads have started is not recommended as it would require thread synchronization to prevent race conditions. In single threaded environments, it is preferable to not use this context at all. Instead, simply create contexts explicitly as described below. The default values are prec=28, rounding=ROUND_HALF_EVEN, and enabled traps for Overflow, InvalidOperation, and DivisionByZero.
class decimal.DivisionByZero  
Signals the division of a non-infinite number by zero. Can occur with division, modulo division, or when raising a number to a negative power. If this signal is not trapped, returns Infinity or -Infinity with the sign determined by the inputs to the calculation.
class decimal.ExtendedContext  
This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to ROUND_HALF_EVEN. All flags are cleared. No traps are enabled (so that exceptions are not raised during computations). Because the traps are disabled, this context is useful for applications that prefer to have result value of NaN or Infinity instead of raising exceptions. This allows an application to complete a run in the presence of conditions that would otherwise halt the program.
class decimal.FloatOperation  
Enable stricter semantics for mixing floats and Decimals. If the signal is not trapped (default), mixing floats and Decimals is permitted in the Decimal constructor, create_decimal() and all comparison operators. Both conversion and comparisons are exact. Any occurrence of a mixed operation is silently recorded by setting FloatOperation in the context flags. Explicit conversions with from_float() or create_decimal_from_float() do not set the flag. Otherwise (the signal is trapped), only equality comparisons and explicit conversions are silent. All other mixed operations raise FloatOperation.
decimal.HAVE_CONTEXTVAR  
The default value is True. If Python is compiled --without-decimal-contextvar, the C version uses a thread-local rather than a coroutine-local context and the value is False. This is slightly faster in some nested context scenarios.
decimal.HAVE_THREADS  
The value is True. Deprecated, because Python now always has threads.
class decimal.Inexact  
Indicates that rounding occurred and the result is not exact. Signals when non-zero digits were discarded during rounding. The rounded result is returned. The signal flag or trap is used to detect when results are inexact.
class decimal.InvalidOperation  
An invalid operation was performed. Indicates that an operation was requested that does not make sense. If not trapped, returns NaN. Possible causes include: Infinity - Infinity
0 * Infinity
Infinity / Infinity
x % 0
Infinity % x
sqrt(-x) and x > 0
0 ** 0
x ** (non-integer)
x ** Infinity
decimal.localcontext(ctx=None)  
Return a context manager that will set the current context for the active thread to a copy of ctx on entry to the with-statement and restore the previous context when exiting the with-statement. If no context is specified, a copy of the current context is used. For example, the following code sets the current decimal precision to 42 places, performs a calculation, and then automatically restores the previous context: from decimal import localcontext

with localcontext() as ctx:
    ctx.prec = 42   # Perform a high precision calculation
    s = calculate_something()
s = +s  # Round the final result back to the default precision
class decimal.Overflow  
Numerical overflow. Indicates the exponent is larger than Emax after rounding has occurred. If not trapped, the result depends on the rounding mode, either pulling inward to the largest representable finite number or rounding outward to Infinity. In either case, Inexact and Rounded are also signaled.
class decimal.Rounded  
Rounding occurred though possibly no information was lost. Signaled whenever rounding discards digits; even if those digits are zero (such as rounding 5.00 to 5.0). If not trapped, returns the result unchanged. This signal is used to detect loss of significant digits.
decimal.ROUND_05UP  
Round away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise round towards zero.
decimal.ROUND_HALF_EVEN  
Round to nearest with ties going to nearest even integer.
decimal.ROUND_HALF_UP  
Round to nearest with ties going away from zero.
decimal.setcontext(c)  
Set the current context for the active thread to c.
class decimal.Subnormal  
Exponent was lower than Emin prior to rounding. Occurs when an operation result is subnormal (the exponent is too small). If not trapped, returns the result unchanged.
class decimal.Underflow  
Numerical underflow with result rounded to zero. Occurs when a subnormal result is pushed to zero by rounding. Inexact and Subnormal are also signaled.
definition.__name__  
The name of the class, function, method, descriptor, or generator instance.
definition.__qualname__  
The qualified name of the class, function, method, descriptor, or generator instance.  New in version 3.3.
delattr(object, name)  
This is a relative of setattr(). The arguments are an object and a string. The string must be the name of one of the object’s attributes. The function deletes the named attribute, provided the object allows it. For example, delattr(x, 'foobar') is equivalent to del x.foobar.
exception DeprecationWarning  
Base class for warnings about deprecated features when those warnings are intended for other Python developers. Ignored by the default warning filters, except in the __main__ module (PEP 565). Enabling the Python Development Mode shows this warning.
class dict(**kwarg)  
class dict(mapping, **kwarg)  
class dict(iterable, **kwarg)  
Create a new dictionary. The dict object is the dictionary class. See dict and Mapping Types — dict for documentation about this class. For other containers see the built-in list, set, and tuple classes, as well as the collections module.
classmethod fromkeys(iterable[, value])  
Create a new dictionary with keys from iterable and values set to value. fromkeys() is a class method that returns a new dictionary. value defaults to None. All of the values refer to just a single instance, so it generally doesn’t make sense for value to be a mutable object such as an empty list. To get distinct values, use a dict comprehension instead.
get(key[, default])  
Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError.
items()  
Return a new view of the dictionary’s items ((key, value) pairs). See the documentation of view objects.