def METHOD_NAME(d, module):
    """Recursively inspect parameter keys according to their types."""
    for param, value in d.items():
        if isinstance(value, dict) and "default" in value:
            inspect_commons(value, param, module)
            try:
                _type = value["type"]
            except KeyError:
                raise KeyError(f"`type` is expected in {param} from {module}") from None  # noqa: E501
            inspect_default_type(
                yaml_params_types[_type],
                value["default"],
                param,
                module,
                )
            yaml_types_to_keys[_type](value, param, module)
            # Validate default value
            inspect_default_value(value["default"], value, param, module)
        elif isinstance(value, dict):
            inspect_commons(value, param, module)
            METHOD_NAME(value, f'{module}_{param}')
        elif param not in DOC_KEYS + ("type",):
            raise Exception(
                f"parameter {param!r} is not expected for {module!r}. "
                "If this is a new parameter, update tests."
                )
    return