def convertTag(tag):
    """ convert tag from abcDef to abc_def
    """
    indices = [0] + [i for i in range(len(tag)) if tag[i].isupper()] + [len(tag)]
    ltag = tag.lower()
    return '_'.join([ltag[indices[i]:indices[i + 1]] for i in range(len(indices) - 1)])