<commit_before>'''
Created on Jan 24, 2015
Name two animals, both mammals, one domestic, the other wild, 
put their letters together and rearrange to spell another 
mammal, this one wild and not seen in North America.
@author: John
'''


class main:
    wild_mammals = set(
                  ['bison',
                   'fox',
                   'wolf',
                   'buffalo',
                   'hare',
                   'rabbit',
                   'squirrel',
                   'camel',
                   'moose',
                   'soomewoc' #ringer moose + cow = soomewoc
                   ])
    domestic_mammals = set(
                       ['cow',
                        'cat',
                        'dog',
                        'pig',
                        'sheep',
                        'llama'
                        ])
    
    def __init__(self, DEBUG):
        self.DEBUG = DEBUG
        # self.combine_and_compare()
    
    def combine_and_compare(self):
        # Sorted each wild animal allows us to compare against the concatenated
        # Domestic + wild animals, so we don't have to deal with the combinatorials around it
        alpha = ["".join(sorted(animal)) for animal in self.wild_mammals]
        if self.DEBUG: print(alpha)
        candidate_list = [] #contains tuples (wild_mammal, domestic_mammal, which_item_in_list_alpha_matched)
        for wild_mammal in self.wild_mammals:
            for domestic_mammal in self.domestic_mammals:
                # Now we sort to allow for the comparison to our list of sorted wild animals names in alpha
                candidate = "".join(sorted(wild_mammal + domestic_mammal))
                if self.DEBUG: print(wild_mammal, ":", domestic_mammal, ":", candidate)
                if candidate in alpha:
                    candidate_list.append((wild_mammal, domestic_mammal, list(self.wild_mammals)[alpha.index(candidate)]))
                    print("candidate:")
                    print("    %s" % wild_mammal)
                    print("    %s" % domestic_mammal)
                    print("    %s" % list(self.wild_mammals)[alpha.index(candidate)])
        print("Done.")
    <commit_msg>Added in local change from Leiran<commit_after>'''
Created on Jan 24, 2015
Name two animals, both mammals, one domestic, the other wild, 
put their letters together and rearrange to spell another 
mammal, this one wild and not seen in North America.
@author: John
'''


class main:
    wild_mammals = set(
                  ['bison',
                   'fox',
                   'wolf',
                   'buffalo',
                   'hare',
                   'rabbit',
                   'squirrel',
                   'camel',
                   'moose',
                   'soomewoc' #ringer moose + cow = soomewoc
                   ])
    domestic_mammals = set(
                       ['cow',
                        'cat',
                        'dog',
                        'pig',
                        'sheep',
                        'llama'
                        ])
    
    def __init__(self, DEBUG=False):
        self.DEBUG = DEBUG
        if self.DEBUG: 
            self.add_wild(["soomewoc", "moose"])
            self.add_domestic(["cow"])
    
    def combine_and_compare(self):
        alpha = ["".join(sorted(animal.lower())) for animal in self.wild_mammals]
        if self.DEBUG: print(alpha)
        candidate_list = [] #contains tuples (wild_mammal, domestic_mammal, correlated alpha)
        for wild_mammal in list(self.wild_mammals):
            for domestic_mammal in list(self.domestic_mammals):
                candidate = "".join(sorted(wild_mammal + domestic_mammal))
                if self.DEBUG: print(wild_mammal, ":", domestic_mammal, ":", candidate)
                if candidate in alpha:
                    candidate_list.append((wild_mammal, domestic_mammal, list(self.wild_mammals)[alpha.index(candidate)]))
                    print("candidate:")
                    print("    %s" % wild_mammal)
                    print("    %s" % domestic_mammal)
                    print("    %s" % list(self.wild_mammals)[alpha.index(candidate)])
        print("Done.")    
{'fraction_non_alphanumeric': 0.09852801519468186, 'fraction_numerical': 0.002849002849002849, 'mean_word_length': 1.4870129870129871, 'pattern_counts': {'":': 4, '<': 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': '2214381', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1133, 'n_words': 293}