nodes: 0, module; 1, function_definition; 2, function_name:index_within_subset; 3, parameters; 4, block; 5, identifier:self; 6, identifier:indexable; 7, identifier:subset_request; 8, default_parameter; 9, expression_statement; 10, comment:# Translate the request within the context of this subset to a; 11, comment:# request to the indexable object; 12, if_statement; 13, comment:# Integer or slice requests can be processed directly.; 14, if_statement; 15, comment:# If requested, we do fancy indexing in sorted order and reshuffle the; 16, comment:# result back in the original order.; 17, if_statement; 18, comment:# If the indexable supports fancy indexing (numpy array, HDF5 dataset),; 19, comment:# the request can be processed directly.; 20, if_statement; 21, comment:# Anything else (e.g. lists) isn't considered to support fancy; 22, comment:# indexing, so Subset does it manually.; 23, return_statement; 24, identifier:sort_indices; 25, False; 26, comment:"""Index an indexable object within the context of this subset.
  
          Parameters
          ----------
          indexable : indexable object
              The object to index through.
          subset_request : :class:`list` or :class:`slice`
              List of positive integer indices or slice that constitutes
              the request *within the context of this subset*. This
              request will be translated to a request on the indexable
              object.
          sort_indices : bool, optional
              If the request is a list of indices, indexes in sorted order
              and reshuffles the result in the original order. Defaults to
              `False`.
  
          """; 27, call; 28, block; 29, else_clause; 30, boolean_operator; 31, block; 32, identifier:sort_indices; 33, block; 34, call; 35, block; 36, call; 37, identifier:isinstance; 38, argument_list; 39, expression_statement; 40, block; 41, call; 42, call; 43, return_statement; 44, return_statement; 45, identifier:isinstance; 46, argument_list; 47, return_statement; 48, identifier:iterable_fancy_indexing; 49, argument_list; 50, identifier:subset_request; 51, attribute; 52, assignment; 53, expression_statement; 54, identifier:isinstance; 55, argument_list; 56, identifier:hasattr; 57, argument_list; 58, subscript; 59, call; 60, identifier:indexable; 61, tuple; 62, subscript; 63, identifier:indexable; 64, identifier:request; 65, identifier:numbers; 66, identifier:Integral; 67, pattern_list; 68, subscript; 69, assignment; 70, identifier:request; 71, attribute; 72, identifier:request; 73, string; 74, identifier:indexable; 75, identifier:request; 76, attribute; 77, argument_list; 78, attribute; 79, attribute; 80, identifier:indexable; 81, identifier:request; 82, identifier:request; 83, identifier:self; 84, list; 85, identifier:request; 86, subscript; 87, identifier:numbers; 88, identifier:Integral; 89, string_content:step; 90, identifier:self; 91, identifier:sorted_fancy_indexing; 92, identifier:indexable; 93, identifier:request; 94, identifier:numpy; 95, identifier:ndarray; 96, identifier:h5py; 97, identifier:Dataset; 98, identifier:subset_request; 99, identifier:self; 100, identifier:subset_request
code: def index_within_subset(self, indexable, subset_request,
                              sort_indices=False):
          """Index an indexable object within the context of this subset.
  
          Parameters
          ----------
          indexable : indexable object
              The object to index through.
          subset_request : :class:`list` or :class:`slice`
              List of positive integer indices or slice that constitutes
              the request *within the context of this subset*. This
              request will be translated to a request on the indexable
              object.
          sort_indices : bool, optional
              If the request is a list of indices, indexes in sorted order
              and reshuffles the result in the original order. Defaults to
              `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)