<commit_before>class Lattice(object):

    def __init__(self, name):
        self.name = name
        self._elements = []

    def __len__(self):
        ''' Get the number of elements in the lattice '''
        return len(self._elements)

    def get_length(self):
        ''' Get the length of the lattice in meters '''
        total_length = 0
        for e in self._elements:
            total_length += e.length
        return total_length

    def add_element(self, element):
        '''
        Add an element to the lattice
        # TODO: modify method to accept a set() arg
        '''
        self._elements.append(element)

    def get_elements(self, family='*'):
        '''
        Get all elements of a lattice from a specified family.
        If no family is specified, return all elements
        '''
        if family == '*':
            return self._elements

        matched_elements = set()
        for element in self._elements:
            if family in element.get_families():
                matched_elements.add(element)
        return matched_elements

    def get_name(self):
        ''' Get the name of the lattice '''
        return self.name

    def print_elements(self):
        print self._elements
        for el in self._elements:
            print el.name<commit_msg>Clear code<commit_after>class Lattice(object):

    def __init__(self, name):
        self.name = name
        self._elements = []

    def __len__(self):
        ''' Get the number of elements in the lattice '''
        return len(self._elements)

    def get_length(self):
        ''' Get the length of the lattice in meters '''
        total_length = 0
        for e in self._elements:
            total_length += e.length
        return total_length

    def add_element(self, element):
        '''
        Add an element to the lattice
        # TODO: modify method to accept a set() arg
        '''
        self._elements.append(element)

    def get_elements(self, family='*'):
        '''
        Get all elements of a lattice from a specified family.
        If no family is specified, return all elements
        '''
        if family == '*':
            return self._elements

        matched_elements = set()
        for element in self._elements:
            if family in element.get_families():
                matched_elements.add(element)
        return matched_elements

    def get_name(self):
        ''' Get the name of the lattice '''
        return self.name

    def print_elements(self):
        for el in self._elements:
            print el.name
{'fraction_non_alphanumeric': 0.08741258741258741, 'fraction_numerical': 0.000777000777000777, 'mean_word_length': 1.8900112233445567, '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': '1594823', 'n_tokens_mistral': 666, 'n_tokens_neox': 639, 'n_words': 230}