def index_within_subset(self, indexable, subset_request,
                            sort_indices=False):
        # Translate the request within the context of this subset to a
        # request to the indexable object
        if isinstance(subset_request, numbers.Integral):
            request, = self[[subset_request]]
        else:
            request = self[subset_request]
        # Integer or slice requests can be processed directly.
        if isinstance(request, numbers.Integral) or hasattr(request, 'step'):
            return indexable[request]
        # If requested, we do fancy indexing in sorted order and reshuffle the
        # result back in the original order.
        if sort_indices:
            return self.sorted_fancy_indexing(indexable, request)
        # If the indexable supports fancy indexing (numpy array, HDF5 dataset),
        # the request can be processed directly.
        if isinstance(indexable, (numpy.ndarray, h5py.Dataset)):
            return indexable[request]
        # Anything else (e.g. lists) isn't considered to support fancy
        # indexing, so Subset does it manually.
        return iterable_fancy_indexing(indexable, request)
Creates, runs, and returns an ExecutionRequest for the given product and subjects.
dataset/ETHPy150Open mila-udem/fuel/fuel/utils/__init__.py/Subset.index_within_subset--crossover with--dataset/ETHPy150Open pantsbuild/pants/tests/python/pants_test/engine/exp/scheduler_test_base.py/SchedulerTestBase.execute_request