def _select_input_type()

in src/functions_framework/_typed_event.py [0:0]


def _select_input_type(decorator_type, annotation_type):
    if decorator_type == None and annotation_type is inspect._empty:
        raise TypeError(
            "The function defined does not contain Type of the input object."
        )

    if (
        decorator_type != None
        and annotation_type is not inspect._empty
        and decorator_type != annotation_type
    ):
        raise TypeError(
            "The object type provided via 'typed' decorator: '{decorator_type}'"
            "is different than the one specified by the function parameter's type annotation : '{annotation_type}'.".format(
                decorator_type=decorator_type, annotation_type=annotation_type
            )
        )

    if decorator_type == None:
        return annotation_type
    return decorator_type