human
Give me a the Python code you requested given the following:
Complete the below
def coerce_types(**kwargs):

    ''''Preprocessing decorator that applies type coercions.
    Parameters
    **kwargs : dict[str -> (type, callable)]
    Keyword arguments mapping function parameter names to pairs of
    (from_type, to_type).
    Examples
    >>> @coerce_types(x=(float, int), y=(int, str))
    ... def func(x, y):
    ...     return (x, y)
    >>> func(1.0, 3)
    (1, \'3\')'
    '''
assistant
#Here is the Python code you requested.
    def _coerce(types):
        return coerce(*types)
    return preprocess(**valmap(_coerce, kwargs))