def _get_unique_common_encodes():
    """
    This function will return both unique_encodes and common_encodes as tuple.

    unique_encodes : In dictionary with encodes name as key and its
       corresponding encode's unique characters among other available encodes.
    common_encodes : In set type which has all common encode compound
       characters from all available encodes.
       i.e. removed common encode single characters

    Author : Arulalan.T

    04.08.2014

    """

    _all_unique_encodes_ = []
    _all_unicode_encodes_ = {}
    _all_common_encodes_ = set([])
    _all_common_encodes_single_char_ = set([])

    for name, encode in _all_encodes_.items():
        encode_utf8 = set([PYTHON3 and ch or ch.decode( 'utf-8') for ch in encode.keys()])
        _all_unicode_encodes_[name] = encode_utf8
    _all_unique_encodes_full_ =_all_unicode_encodes_.copy()

    for supname, super_encode in _all_unicode_encodes_.items():
        for subname, sub_encode in _all_unicode_encodes_.items():
            if supname == subname: continue
            # get unique of super_encode among other encodings
            super_encode = sub_encode - super_encode
        # get common for all over encodings
        common = _all_unique_encodes_full_[supname] - super_encode
        # merge common to all encodings common
        _all_common_encodes_ = _all_common_encodes_.union(common)
        # store super_encode's unique keys with its name
        _all_unique_encodes_.append((supname, super_encode))
    for ch in _all_common_encodes_:
        # collect single common chars
        if len(ch) == 1: _all_common_encodes_single_char_.add(ch)
    # end of for ch in _all_common_encodes_:

    # remove single common char from compound common chars
    _all_common_encodes_ -= _all_common_encodes_single_char_


    if __WRITE_CHARS_TXT:
        # write common compound characters of all encodes
        f = open('all.encodes.common.chars.txt', 'w')
        for ch in _all_common_encodes_:
            ch = ch.encode('utf-8')
            for encode_keys in _all_encodes_.values():
                if ch in encode_keys:
                    uni = encode_keys[ch]
                    break
                # end of if ch in encode_keys:
            # end of for encode_keys in _all_encodes_.values():
            f.write(ch + '  =>  ' + uni + '\n')
        # end of for ch in _all_common_encodes_:
        f.close()
        # write unique compound characters of all encodes
        for encode_name, encode_keys in _all_unique_encodes_:
            f = open(encode_name + '.unique.chars.txt', 'w')
            for ch in encode_keys:
                ch = ch.encode('utf-8')
                uni = _all_encodes_[encode_name][ch]
                f.write(ch + '  =>  ' + uni + '\n')
            # end of for ch in encode_keys:
            f.close()
        # end of for encode_name, encode_keys in _all_unique_encodes_:
    # end of if __WRITE_CHARS_TXT:

    return (_all_unique_encodes_, _all_common_encodes_)
# end of def _get_unique_common_encodes():
dataset/ETHPy150Open Ezhil-Language-Foundation/open-tamil/tamil/txt2unicode/encode2unicode.py/_get_unique_common_encodes/swapped operands of `-`