def METHOD_NAME(self, index):
    try:
        index = int(index)
    except TypeError:
        raise ValueError
    if not 0 < index <= len(self._connections):
        raise ValueError
    return index