from typing import Dict
from typing import Any


def _transform_underscore(d: Dict[str, Any]) -> Dict[str, Any]:
    """transform "-" to "_" recursively

    Args:
        d:

    Returns:
        Dict[str, Any]: new dict
    """
    new_dict = d.copy()
    for k, v in new_dict.items():
        if isinstance(v, Dict):
            new_dict[k] = _transform_underscore(v)
    for k in list(new_dict.keys()):
        if "-" in k:
            new_dict[k.replace("-", "_")] = new_dict[k]
            del new_dict[k]
    return new_dict