<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dict_to_paths(dict_):
 """Convert a dict to metric paths. { '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