(dict_)
return metrics
Convert a dict to metric paths.

    >>> dict_to_paths({'foo': {'bar': 1}, 'baz': 2})
    {
        'foo.bar': 1,
        'baz': 2,
    }
Convert a dict to metric paths.
Convert a dict to metric paths .
def dict_to_paths(dict_):
    """Convert a dict to metric paths.

    >>> dict_to_paths({'foo': {'bar': 1}, 'baz': 2})
    {
        'foo.bar': 1,
        'baz': 2,
    }
    """
    metrics = {}
    for k, v in dict_.iteritems():
        if isinstance(v, dict):
            submetrics = dict_to_paths(v)
            for subk, subv in submetrics.iteritems():
                metrics['.'.join([str(k), str(subk)])] = subv
        else:
            metrics[k] = v
    return metrics
def dict_to_paths ( dict_ ) : metrics = { } for k , v in dict_ . iteritems ( ) : if isinstance ( v , dict ) : submetrics = dict_to_paths ( v ) for subk , subv in submetrics . iteritems ( ) : metrics [ '.' . join ( [ str ( k ) , str ( subk ) ] ) ] = subv else : metrics [ k ] = v return metrics