def call_metric()

in src/smclarify/bias/metrics/__init__.py [0:0]


def call_metric(metric: Callable[..., float], **kwargs) -> float:
    """
    Call metric function with keyword arguments. The excess arguments will be ignored.

    :param metric: a callable for a bias metric
    :param kwargs: keyword argument list
    :return: Return value of the callable
    :raise: KeyError: if a mandatory argument is missing from kwargs.
    """
    return metric(**{key: kwargs[key] for key in inspect.signature(metric).parameters.keys()})