def SegEnd(ea):
    seg = idaapi.getseg(ea)

    if not seg:
        return BADADDR
    else:
        return seg.endEA
Like a string split, but don't break substrings inside quotes.
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/SegEnd--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/text.py/splitQuoted