def param(name, type_name, *validators, **kwargs):
def _param(func):<EOL><INDENT>func = annotated(func)<EOL>valids = _parse_validators(validators)<EOL>func.metadata.add_param(name, type_name, valids, **kwargs)<EOL>if func.decorated:<EOL><INDENT>return func<EOL><DEDENT>func.decorated = True<EOL>return decorate(func, _check_and_execute)<EOL><DEDENT>return _param<EOL>
Decorate a function to give type information about its parameters.

    This function stores a type name, optional description and optional list
    of validation functions along with the decorated function it is called
    on in order to allow run time type conversions and validation.

    Args:
        name (string): name of the parameter
        type_name (string): The name of a type that will be known to the type
            system by the time this function is called for the first time.  Types
            are lazily loaded so it is not required that the type resolve correctly
            at the point in the module where this function is defined.
        validators (list(string or tuple)): A list of validators.  Each validator
            can be defined either using a string name or as an n-tuple of the form
            [name, \\*extra_args].  The name is used to look up a validator function
            of the form validate_name, which is called on the parameters value to
            determine if it is valid.  If extra_args are given, they are passed
            as extra arguments to the validator function, which is called as:

            validator(value, \\*extra_args)
        desc (string): An optional descriptioon for this parameter that must be
            passed as a keyword argument.

    Returns:
        callable: A decorated function with additional type metadata