skactiveml.utils.check_type#

skactiveml.utils.check_type(obj, name, *target_types, target_vals=None, indicator_funcs=None)[source]#

Check if obj is one of the given types. It is also possible to allow specific values. Further it is possible to pass indicator functions that can also accept obj. Thereby, obj must either have a correct type a correct value or be accepted by an indicator function.

Parameters
objobject

The object to be checked.

namestr

The variable name of the object.

target_typesiterable

The possible types.

target_valsiterable, default=None

Possible further values that the object is allowed to equal.

indicator_funcsiterable, default=None

Possible further custom indicator (boolean) functions that accept the object by returning True if the object is passed as a parameter.