'Combine two codes that always appear in pair into a single code.
The intent is to create more unused codes.'

def _combine_codes(self):

    possible_codes = []
    a_code = set(re.findall('(?msu).', self.coded_txt))
    for code in a_code:
        single_code = set(re.findall(('(?msu)%s.' % re.escape(code)), self.coded_txt))
        if (len(single_code) == 1):
            possible_codes.append(single_code.pop())
    for code in possible_codes:
        self.coded_txt = self.coded_txt.replace(code, code[0])
        self.codes[ord(code[0])] = ('%s%s' % (self.codes[ord(code[0])], self.codes[ord(code[1])]))
