def _flatten_dict(input_dict: dict) -> dict:
    """
    Flattens a nested dictionary, keeping only keys with non-dict values. Note
    that keys will be the underscore-delimited concatenation of the nested path
    of keys from the original dict.
    """
    res = {}
    for k, v in input_dict.items():
        if type(v) is not dict:
            res[k] = v
        else:
            nest = _flatten_dict(v)
            for key, value in nest.items():
                new_key = "{}_{}".format(k, key)
                res[new_key] = value
    return res