nodes: 0, module; 1, function_definition; 2, function_name:sorted_fancy_indexing; 3, parameters; 4, block; 5, identifier:indexable; 6, identifier:request; 7, expression_statement; 8, if_statement; 9, return_statement; 10, comment:"""Safe fancy indexing.
  
          Some objects, such as h5py datasets, only support list indexing
          if the list is sorted.
  
          This static method adds support for unsorted list indexing by
          sorting the requested indices, accessing the corresponding
          elements and re-shuffling the result.
  
          Parameters
          ----------
          request : list of int
              Unsorted list of example indices.
          indexable : any fancy-indexable object
              Indexable we'd like to do unsorted fancy indexing on.
  
          """; 11, comparison_operator:len(request) > 1; 12, block; 13, else_clause; 14, identifier:data; 15, call; 16, integer:1; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, block; 21, identifier:len; 22, argument_list; 23, assignment; 24, assignment; 25, assignment; 26, expression_statement; 27, identifier:request; 28, identifier:indices; 29, call; 30, identifier:data; 31, call; 32, subscript; 33, subscript; 34, assignment; 35, attribute; 36, argument_list; 37, attribute; 38, argument_list; 39, identifier:data; 40, identifier:indices; 41, identifier:indexable; 42, subscript; 43, ellipsis:...; 44, identifier:data; 45, subscript; 46, identifier:numpy; 47, identifier:argsort; 48, identifier:request; 49, identifier:numpy; 50, identifier:empty; 51, keyword_argument; 52, keyword_argument; 53, call; 54, identifier:indices; 55, identifier:indexable; 56, identifier:request; 57, identifier:shape; 58, binary_operator:(len(request),) + indexable.shape[1:]; 59, identifier:dtype; 60, attribute; 61, attribute; 62, argument_list; 63, tuple; 64, subscript; 65, identifier:indexable; 66, identifier:dtype; 67, identifier:numpy; 68, identifier:array; 69, identifier:request; 70, call; 71, attribute; 72, slice; 73, identifier:len; 74, argument_list; 75, identifier:indexable; 76, identifier:shape; 77, integer:1; 78, identifier:request
code: def sorted_fancy_indexing(indexable, request):
          """Safe fancy indexing.
  
          Some objects, such as h5py datasets, only support list indexing
          if the list is sorted.
  
          This static method adds support for unsorted list indexing by
          sorting the requested indices, accessing the corresponding
          elements and re-shuffling the result.
  
          Parameters
          ----------
          request : list of int
              Unsorted list of example indices.
          indexable : any fancy-indexable object
              Indexable we'd like to do unsorted fancy indexing on.
  
          """
          if len(request) > 1:
              indices = numpy.argsort(request)
              data = numpy.empty(shape=(len(request),) + indexable.shape[1:],
                                 dtype=indexable.dtype)
              data[indices] = indexable[numpy.array(request)[indices], ...]
          else:
              data = indexable[request]
          return data