graphit/graph_io/io_helpers.py
def nest_flattened_dict(graph_dict, sep='.'):
    """
    Convert a dictionary that has been flattened by the
    `_flatten_nested_dict` method to a nested representation
    
    :param graph_dict: dictionary to nest
    :type graph_dict:  dict
    :param sep:        concatenation seperator
    :type sep:         str
    
    :return:           nested dictionary
    :rtype:            dict
    """
    
    nested_dict = {}
    for key, value in sorted(graph_dict.items()):
        
        splitted = key.split(sep)
        if len(splitted) == 1:
            nested_dict[key] = value
        
        d = nested_dict
        for k in splitted[:-1]:
            if k not in d:
                d[k] = {}
            d = d[k]
        
        d[splitted[-1]] = value
    
    return nested_dict

    Convert a dictionary that has been flattened by the
    `_flatten_nested_dict` method to a nested representation
    
    :param graph_dict: dictionary to nest
    :type graph_dict:  dict
    :param sep:        concatenation seperator
    :type sep:         str
    
    :return:           nested dictionary
    :rtype:            dict
    
Convert a dictionary that has been flattened by the
`_flatten_nested_dict` method to a nested representation
Convert a dictionary that has been flattened by the ` _flatten_nested_dict ` method to a nested representation
def nest_flattened_dict(graph_dict, sep='.'):
    nested_dict = {}
    for key, value in sorted(graph_dict.items()):
        splitted = key.split(sep)
        if len(splitted) == 1:
            nested_dict[key] = value
        d = nested_dict
        for k in splitted[:-1]:
            if k not in d:
                d[k] = {}
            d = d[k]
        d[splitted[-1]] = value
    return nested_dict
def nest_flattened_dict ( graph_dict , sep = '.' ) : nested_dict = { } for key , value in sorted ( graph_dict . items ( ) ) : splitted = key . split ( sep ) if len ( splitted ) == 1 : nested_dict [ key ] = value d = nested_dict for k in splitted [ : - 1 ] : if k not in d : d [ k ] = { } d = d [ k ] d [ splitted [ - 1 ] ] = value return nested_dict
Convert a dictionary that has been flattened by the
`_flatten_nested_dict` method to a nested representation
Convert a dictionary that has been flattened by the ` _flatten_nested_dict ` method to a nested representation
"""
    Convert a dictionary that has been flattened by the
    `_flatten_nested_dict` method to a nested representation
    
    :param graph_dict: dictionary to nest
    :type graph_dict:  dict
    :param sep:        concatenation seperator
    :type sep:         str
    
    :return:           nested dictionary
    :rtype:            dict
    """
None
dict
graph_dict
dictionary to nest
dictionary to nest
sep
None