def METHOD_NAME(self, index):
    """ project idx into range(len) """
    if index <= -len(self):
        return 0
    if index < 0:
        return index + len(self)
    if index >= len(self):
        return len(self)
    return index