Assert that @obj is an instance of @cls

        Note that you cannot use this to unmarshal JSON if @cls
        is a tuple of types, it can only be a single type.

        Will also unmarshal JSON objects to Python objects if @obj
        is an instance of dict and @cls is not dict

        Args:
            obj:        object instance, The object to type assert
            cls:        type,  The class type to assert
            allow_none: bool, True to allow '@obj is None', otherwise False
            cast_from:  type-or-tuple-of-types, If @obj is an instance
                        of this type(s), cast it to @cast_to
            cast_to:    type, The type to cast @obj to if it's an instance
                        of @cast_from, or None to cast to @cls.
                        If you need more than type(x), use a lambda or
                        factory function.
            dynamic:    @cls, A dynamic default value if @obj is None,
                        and @dynamic is not None.  @allow_none should be False
                        Valid uses:
                            datetime.datetime.now()
                            int(time.time())
                            # Or, to avoid the Python singleton bug when
                            # using arg=[], for example:
                            [], {}, set()
            choices:    iterable-or-None, If not None, @obj must
                        be in @choices
            ctor:       None-or-static-method: Use this method as the
                        constructor instead of __init__
        Returns:
            @obj
        Raises:
            TypeError: if @obj is not an instance of @cls

def type_assert(
    obj,
    cls,
    allow_none=False,
    cast_from=None,
    cast_to=None,
    dynamic=None,
    choices=None,
    ctor=None,
):
    """ Assert that @obj is an instance of @cls

        Note that you cannot use this to unmarshal JSON if @cls
        is a tuple of types, it can only be a single type.

        Will also unmarshal JSON objects to Python objects if @obj
        is an instance of dict and @cls is not dict

        Args:
            obj:        object instance, The object to type assert
            cls:        type,  The class type to assert
            allow_none: bool, True to allow '@obj is None', otherwise False
            cast_from:  type-or-tuple-of-types, If @obj is an instance
                        of this type(s), cast it to @cast_to
            cast_to:    type, The type to cast @obj to if it's an instance
                        of @cast_from, or None to cast to @cls.
                        If you need more than type(x), use a lambda or
                        factory function.
            dynamic:    @cls, A dynamic default value if @obj is None,
                        and @dynamic is not None.  @allow_none should be False
                        Valid uses:
                            datetime.datetime.now()
                            int(time.time())
                            # Or, to avoid the Python singleton bug when
                            # using arg=[], for example:
                            [], {}, set()
            choices:    iterable-or-None, If not None, @obj must
                        be in @choices
            ctor:       None-or-static-method: Use this method as the
                        constructor instead of __init__
        Returns:
            @obj
        Raises:
            TypeError: if @obj is not an instance of @cls
    """
    _check_choices(obj, choices)

    return _check(
        obj,
        cls,
        allow_none,
        cast_from,
        cast_to,
        dynamic=dynamic,
        ctor=ctor,
    )