def _start_stop(item):
    if isinstance(item, tuple):
        item = item[0]
    if isinstance(item, slice):
        # Slice.
        if item.step not in (None, 1):
            return NotImplementedError()
        return item.start, item.stop
    elif isinstance(item, (list, np.ndarray)):
        # List or array of indices.
        return np.min(item), np.max(item)
    else:
        # Integer.
        return item, item + 1
Returns a list of selected document type's optional metadata types.
dataset/ETHPy150Open kwikteam/phy/phy/io/array.py/_start_stop--crossover with--dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/metadata/api_views.py/APIDocumentTypeMetadataTypeOptionalListView.get