def METHOD_NAME(metrics, path, rev):
    if isinstance(metrics, (int, float, str)):
        return metrics
    if not isinstance(metrics, dict):
        return None
    ret = {}
    for key, val in metrics.items():
        m = METHOD_NAME(val, path, rev)
        if m not in (None, {}):
            ret[key] = m
        else:
            logger.debug(
                (
                    "Could not parse '%s' metric from '%s' at '%s' "
                    "due to its unsupported type: '%s'"
                ),
                key,
                path,
                rev,
                type(val).__name__,
            )
    return ret