<commit_before>import networkx as nx

class Multinet(nx.DiGraph):
    '''
    Multiplex network class.
    '''
    
    def __init__(self):
        super(self.__class__,self).__init__()
        self.graph['layers'] = []

    def layers():
        return self.graph['layers']<commit_msg>Simple functions<commit_after>import networkx as nx

class Multinet(nx.DiGraph):
    '''
    Multiplex network class.
    '''
    
    def __init__(self):
        super(self.__class__,self).__init__()
        self.graph['layers'] = []

    def _add_layer(self,layer):
        if layer not in self.layers():
            self.graph['layers'].append(layer)
        
    def layers(self):
        return self.graph['layers']

    def add_edge(self, u, v, layer, weight=1.0):
        super(self.__class__,self).add_edge(u,v)

        self._add_layer(layer)
            
        if not self[u][v].has_key('multiplex'):
            self[u][v]['multiplex'] = {}
        self[u][v]['multiplex'][layer] = weight
{'fraction_non_alphanumeric': 0.14994934143870314, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 2.466666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1626270', 'n_tokens_mistral': 314, 'n_tokens_neox': 308, 'n_words': 56}