<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def joinMeiUyir(mei_char, uyir_char):
 """ This function join mei character and uyir character, and retuns as compound uyirmei unicode character. Inputs: mei_char : It must be unicode tamil mei char. uyir_char : It must be unicode tamil uyir char. Written By : Arulalan.T Date : 22.09.2014 """

    if not mei_char: return uyir_char
    if not uyir_char: return mei_char
    
    if not isinstance(mei_char, PYTHON3 and str or unicode):
        raise ValueError(u"Passed input mei character '%s' must be unicode, not just string" % mei_char)
    if not isinstance(uyir_char, PYTHON3 and str or unicode) and uyir_char != None:
        raise ValueError(u"Passed input uyir character '%s' must be unicode, not just string" % uyir_char)
    if mei_char not in grantha_mei_letters:
        raise ValueError(u"Passed input character '%s' is not a tamil mei character" % mei_char)
    if uyir_char not in uyir_letters:
        raise ValueError(u"Passed input character '%s' is not a tamil uyir character" % uyir_char)
    if uyir_char:
        uyiridx = uyir_letters.index(uyir_char)
    else:
        return mei_char
    meiidx = grantha_mei_letters.index(mei_char)
    # calculate uyirmei index
    uyirmeiidx = meiidx*12 + uyiridx
    return grantha_uyirmei_letters[uyirmeiidx]