(entity, sep)
return entity[:idx], sep, entity[idx + 1:]
Python2.4 doesn't have an rpartition method so we provide
    our own that mimics str.rpartition from later releases.

    Split the string at the last occurrence of sep, and return a
    3-tuple containing the part before the separator, the separator
    itself, and the part after the separator. If the separator is not
    found, return a 3-tuple containing two empty strings, followed
    by the string itself.
Python2.4 doesn't have an rpartition method so we provide
    our own that mimics str.rpartition from later releases.
Python2 . 4 doesn t have an rpartition method so we provide our own that mimics str . rpartition from later releases .
def _rpartition(entity, sep):
    """Python2.4 doesn't have an rpartition method so we provide
    our own that mimics str.rpartition from later releases.

    Split the string at the last occurrence of sep, and return a
    3-tuple containing the part before the separator, the separator
    itself, and the part after the separator. If the separator is not
    found, return a 3-tuple containing two empty strings, followed
    by the string itself.
    """
    idx = entity.rfind(sep)
    if idx == -1:
        return '', '', entity
    return entity[:idx], sep, entity[idx + 1:]
def _rpartition ( entity , sep ) : idx = entity . rfind ( sep ) if idx == - 1 : return '' , '' , entity return entity [ : idx ] , sep , entity [ idx + 1 : ]