def _splitext(p, sep, altsep, extsep):
    # NOTE: This code must work for text and bytes strings.

    sepIndex = p.rfind(sep)
    if altsep:
        altsepIndex = p.rfind(altsep)
        sepIndex = max(sepIndex, altsepIndex)

    dotIndex = p.rfind(extsep)
    if dotIndex > sepIndex:
        # skip all leading dots
        filenameIndex = sepIndex + 1
        while filenameIndex < dotIndex:
            if p[filenameIndex:filenameIndex+1] != extsep:
                return p[:dotIndex], p[dotIndex:]
            filenameIndex += 1

    return p, p[:0]
Create a map for indices that is be compact (do not have unused indices)
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/genericpath.py/_splitext--crossover with--dataset/ETHPy150Open LxMLS/lxmls-toolkit/lxmls/readers/pos_corpus.py/compacify