<commit_before>from gene import Gene, clone_gene

class Chromosome:
    # Chromosome - a much longer dna sequence containing many genes.
    # __genes - an ordered list of Genes
    # __name - name of the chromosome
    # dna - an listed of Gene's dna
    # dna_total_length - sum of the lenght of all genes's dna
    def __init__(self, genes, name=""):
        assert all(isinstance(gene, Gene) for gene in genes)
        self.__genes = genes
        self.__name = name

    def __get_number_of_genes(self):
        return len(self.__genes)

    def __get_name(self):
        return self.__name

    def __get_dna_total_length(self):
        length = 0
        for gene in self.__genes:
            length += gene.length
        return length

    def __get_dna(self):
        return [gene.dna for gene in self.__genes]

    def __set_dna(self, dna):
        assert self.num_of_genes == len(dna)<commit_msg>Assertion when the length of genes are inconsistent.<commit_after>from gene import Gene, clone_gene

class Chromosome:
    # Chromosome - a much longer dna sequence containing many genes.
    # __genes - an ordered list of Genes
    # __name - name of the chromosome
    # dna - an listed of Gene's dna
    # dna_total_length - sum of the lenght of all genes's dna
    def __init__(self, genes, name=""):
        length_of_gene = genes[0].length
        assert all(isinstance(gene, Gene) and gene.length == length_of_gene for gene in genes)
        self.__genes = genes
        self.__name = name

    def __get_number_of_genes(self):
        return len(self.__genes)

    def __get_name(self):
        return self.__name

    def __get_dna_total_length(self):
        length = 0
        for gene in self.__genes:
            length += gene.length
        return length

    def __get_dna(self):
        return [gene.dna for gene in self.__genes]

    def __set_dna(self, dna):
        assert self.num_of_genes == len(dna)
{'fraction_non_alphanumeric': 0.0766839378238342, 'fraction_numerical': 0.0015544041450777201, 'mean_word_length': 2.5109090909090908, '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': '2792639', 'n_tokens_mistral': 631, 'n_tokens_neox': 574, 'n_words': 193}