def map_param_names(
        req_params: dict, sig_params: List[inspect.Parameter]) -> dict:
    """Maps request param names to match logic function param names.

    If a doctor type defined a `param_name` attribute for the name of the
    parameter in the request, we should use that as the key when looking up
    the value for the request parameter.

    When we declare a type we can specify what the parameter name
    should be in the request that the annotated type should get mapped to.

    >>> from doctor.types import number
    >>> Latitude = number('The latitude', param_name='location.lat')
    >>> def my_logic(lat: Latitude): pass
    >>> request_params = {'location.lat': 45.2342343}

    In the above example doctor knows to pass the value at key `location.lat`
    to the logic function variable named `lat` since it's annotated by the
    `Latitude` type which specifies what the param_name is on the request.

    :param dict req_params: The parameters specified in the request.
    :param dict sig_params: The logic function's signature parameters.
    :returns: A dict of re-mapped params.
    """
    new_request_params = {}
    for k, param in sig_params.items():
        param_name = getattr(param.annotation, 'param_name', None)
        key = k if param_name is None else param_name
        if key in req_params:
            new_request_params[k] = req_params[key]
    return new_request_params
Maps request param names to match logic function param names.

    If a doctor type defined a `param_name` attribute for the name of the
    parameter in the request, we should use that as the key when looking up
    the value for the request parameter.

    When we declare a type we can specify what the parameter name
    should be in the request that the annotated type should get mapped to.

    >>> from doctor.types import number
    >>> Latitude = number('The latitude', param_name='location.lat')
    >>> def my_logic(lat: Latitude): pass
    >>> request_params = {'location.lat': 45.2342343}

    In the above example doctor knows to pass the value at key `location.lat`
    to the logic function variable named `lat` since it's annotated by the
    `Latitude` type which specifies what the param_name is on the request.

    :param dict req_params: The parameters specified in the request.
    :param dict sig_params: The logic function's signature parameters.
    :returns: A dict of re-mapped params.