'Create new codes from codes that occur in pairs often.'

def _new_codes(self):

    possible_new_codes = list(set(re.findall('(?msu)..', self.coded_txt)))
    new_codes_count = []
    for c in possible_new_codes:
        count = self.coded_txt.count(c)
        if (count > 2):
            new_codes_count.append((c, count))
    possible_new_codes = [x[0] for x in sorted(new_codes_count, key=(lambda c: c[1]))]
    return possible_new_codes
