Module Expr Str Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore BinOpMult NameLoad BinOpPow SubscriptLoad NameLoad Index NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd Call NameLoad NameLoad NameLoad CompareIn Str NameLoad body Return TupleLoad Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Num Index Num NameLoad Return TupleLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIs NameLoad NameLoad body Continue orelse If NameLoad body If CompareEq Call NameLoad NameLoad Num body Assign ListStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If BoolOpAnd CompareEq NameLoad Num CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad TupleLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Continue If UnaryOpNot CompareLtE Call NameLoad Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str SubscriptLoad NameLoad Index NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad Assign NameStore Dict For NameStore NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num NameLoad For NameStore NameLoad body If Call NameLoad SubscriptLoad NameLoad Index NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num orelse If NameLoad body Raise Call NameLoad Call AttributeLoad Str attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad NameLoad Index NameLoad Return TupleLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore TupleLoad NameLoad Assign NameStore Call NameLoad NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad Call AttributeLoad NameLoad attr ListComp Call NameLoad NameLoad comprehension NameStore NameLoad orelse Assign TupleStore NameStore NameStore TupleLoad NameLoad Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad FunctionDef arguments args defaults vararg kwarg body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Assign NameStore GeneratorExp IfExp NameLoad Call NameLoad NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad Return Call AttributeLoad NameLoad attr GeneratorExp IfExp CompareIs NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareIs SubscriptLoad NameLoad Index Num NameLoad body Return NameLoad Return Call AttributeLoad NameLoad attr NameLoad IfExp SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num NameLoad SubscriptLoad NameLoad Index Num decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad FunctionDef arguments args defaults vararg kwarg body For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body If BoolOpAnd NameLoad CompareNotEq AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad NameLoad Str AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list Return NameLoad decorator_list
N/A N/A 
    pint.registry_helpers
    ~~~~~~~~~~~~~~~~~~~~~

    Miscellaneous methods of the registry writen as separate functions.

    :copyright: 2016 by Pint Authors, see AUTHORS for more details..
    :license: BSD, see LICENSE for more details.
 N/A functools compat string_types zip_longest errors DimensionalityError util to_units_container _replace_units N/A N/A original_units values_by_name N/A N/A N/A Convert a unit compatible type to a UnitsContainer.

    :param original_units: a UnitsContainer instance.
    :param values_by_name: a map between original names and the new values.
     N/A q 1 N/A N/A arg_name exponent N/A N/A original_units items N/A N/A q N/A q N/A N/A values_by_name N/A arg_name exponent N/A N/A to_units_container q N/A _to_units_container N/A N/A a N/A N/A N/A Convert a unit compatible type to a UnitsContainer,
    checking if it is string field prefixed with an equal
    (which is considered a reference)

    Return a tuple with the unit container and a boolean indicating if it was a reference.
     N/A N/A N/A isinstance a string_types N/A = a N/A N/A N/A N/A to_units_container N/A N/A N/A a split = 1 N/A 1 True N/A N/A N/A to_units_container a False N/A _parse_wrap_args N/A N/A args N/A N/A N/A defs_args N/A set N/A defs_args_ndx N/A set N/A dependent_args_ndx N/A set N/A unit_args_ndx N/A set N/A args_as_uc N/A N/A _to_units_container arg N/A arg args N/A N/A ndx N/A arg is_ref N/A enumerate args_as_uc N/A N/A N/A arg None N/A N/A N/A N/A is_ref N/A N/A N/A N/A len arg 1 N/A N/A N/A N/A key value N/A N/A arg items N/A N/A N/A value 1 N/A key defs_args N/A N/A N/A N/A defs_args add key N/A N/A N/A defs_args_ndx add ndx N/A N/A args_as_uc N/A ndx N/A key True N/A N/A N/A N/A dependent_args_ndx add ndx N/A N/A N/A N/A dependent_args_ndx add ndx N/A N/A N/A N/A unit_args_ndx add ndx N/A ndx dependent_args_ndx N/A N/A N/A arg is_ref N/A args_as_uc N/A ndx N/A N/A N/A isinstance arg dict N/A N/A N/A N/A N/A N/A set N/A N/A arg keys defs_args N/A N/A N/A ValueError N/A Found a missing token while wrapping a function: Not all variable referenced in %s are defined using ! N/A args N/A ndx _converter N/A N/A ureg values strict N/A N/A N/A new_values N/A list N/A value N/A value values N/A values_by_name N/A N/A ndx defs_args_ndx N/A N/A N/A values_by_name N/A N/A N/A args_as_uc N/A ndx N/A 0 N/A values N/A ndx N/A N/A new_values N/A ndx N/A N/A values N/A ndx _magnitude N/A ndx dependent_args_ndx N/A N/A N/A new_values N/A ndx N/A N/A ureg _convert N/A N/A values N/A ndx _magnitude N/A N/A values N/A ndx _units N/A _replace_units N/A N/A args_as_uc N/A ndx N/A 0 values_by_name N/A ndx unit_args_ndx N/A N/A N/A isinstance N/A values N/A ndx N/A ureg Quantity N/A N/A N/A new_values N/A ndx N/A N/A ureg _convert N/A N/A values N/A ndx _magnitude N/A N/A values N/A ndx _units N/A N/A args_as_uc N/A ndx N/A 0 N/A N/A strict N/A N/A N/A ValueError N/A N/A A wrapped function using strict=True requires quantity for all arguments with not None units. (error found for {0}, {1}) format N/A N/A args_as_uc N/A ndx N/A 0 N/A new_values N/A ndx N/A N/A new_values values_by_name N/A N/A _converter N/A wraps N/A N/A ureg ret args strict N/A True N/A N/A Wraps a function to become pint-aware.

    Use it when a function requires a numerical value but in some specific
    units. The wrapper function will take a pint quantity, convert to the units
    specified in `args` and then call the wrapped function with the resulting
    magnitude.

    The value returned by the wrapped function will be converted to the units
    specified in `ret`.

    Use None to skip argument conversion.
    Set strict to False, to accept also numerical values.

    :param ureg: a UnitRegistry instance.
    :param ret: output units.
    :param args: iterable of input units.
    :param strict: boolean to indicate that only quantities are accepted.
    :return: the wrapped function.
    :raises:
        :class:`ValueError` if strict and one of the arguments is not a Quantity.
     N/A N/A N/A isinstance args N/A list tuple N/A N/A args N/A args N/A converter N/A _parse_wrap_args args N/A N/A isinstance ret N/A list tuple N/A N/A N/A container ret N/A True N/A N/A ret __class__ N/A N/A _to_units_container arg N/A arg ret N/A N/A N/A container ret N/A False N/A _to_units_container ret decorator N/A N/A func N/A N/A N/A assigned N/A tuple N/A attr N/A attr N/A functools WRAPPER_ASSIGNMENTS N/A hasattr func attr N/A updated N/A tuple N/A attr N/A attr N/A functools WRAPPER_UPDATES N/A hasattr func attr wrapper N/A N/A N/A values kw N/A N/A N/A new_values values_by_name N/A converter ureg values strict N/A result N/A func new_values kw N/A container N/A N/A out_units N/A N/A is_ref N/A _replace_units r values_by_name r N/A N/A r is_ref ret N/A N/A N/A ret __class__ N/A N/A N/A unit None res N/A N/A ureg Quantity res unit N/A N/A unit res N/A zip out_units result N/A N/A N/A ret N/A 0 None N/A N/A result N/A N/A N/A ureg Quantity result N/A N/A ret N/A 1 N/A _replace_units N/A ret N/A 0 values_by_name N/A ret N/A 0 N/A N/A N/A functools wraps func assigned assigned updated updated N/A wrapper N/A N/A decorator N/A check N/A N/A ureg N/A args N/A N/A Decorator to for quantity type checking for function inputs.

    Use it to ensure that the decorated function input parameters match
    the expected type of pint quantity.

    Use None to skip argument checking.

    :param ureg: a UnitRegistry instance.
    :param args: iterable of input units.
    :return: the wrapped function.
    :raises:
        :class:`DimensionalityError` if the parameters don't match dimensions
     N/A dimensions N/A N/A N/A ureg get_dimensionality dim N/A dim args decorator N/A N/A func N/A N/A N/A assigned N/A tuple N/A attr N/A attr N/A functools WRAPPER_ASSIGNMENTS N/A hasattr func attr N/A updated N/A tuple N/A attr N/A attr N/A functools WRAPPER_UPDATES N/A hasattr func attr wrapper N/A N/A N/A values kwargs N/A N/A N/A dim value N/A zip_longest dimensions values N/A N/A N/A dim N/A N/A value dimensionality dim N/A N/A N/A DimensionalityError value a quantity of N/A value dimensionality dim N/A N/A func values kwargs N/A N/A N/A functools wraps func assigned assigned updated updated N/A wrapper N/A N/A decorator N/A