nodes: 0, module; 1, function_definition; 2, function_name:slice_indexer; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, comment:# return a slice; 13, if_statement; 14, if_statement; 15, return_statement; 16, identifier:start; 17, None; 18, identifier:end; 19, None; 20, identifier:step; 21, None; 22, identifier:kind; 23, None; 24, comment:"""
          For an ordered or unique index, compute the slice indexer for input
          labels and step.
  
          Parameters
          ----------
          start : label, default None
              If None, defaults to the beginning
          end : label, default None
              If None, defaults to the end
          step : int, default None
          kind : string, default None
  
          Returns
          -------
          indexer : slice
  
          Raises
          ------
          KeyError : If key does not exist, or key is not unique and index is
              not ordered.
  
          Notes
          -----
          This function assumes that the data is sorted, so use at your own peril
  
          Examples
          ---------
          This is a method on all index types. For example you can do:
  
          >>> idx = pd.Index(list('abcd'))
          >>> idx.slice_indexer(start='b', end='c')
          slice(1, 3)
  
          >>> idx = pd.MultiIndex.from_arrays([list('abcd'), list('efgh')])
          >>> idx.slice_indexer(start='b', end=('c', 'g'))
          slice(1, 3)
          """; 25, assignment; 26, not_operator; 27, block; 28, not_operator; 29, block; 30, call; 31, pattern_list; 32, call; 33, call; 34, raise_statement; 35, call; 36, raise_statement; 37, identifier:slice; 38, argument_list; 39, identifier:start_slice; 40, identifier:end_slice; 41, attribute; 42, argument_list; 43, identifier:is_scalar; 44, argument_list; 45, call; 46, identifier:is_scalar; 47, argument_list; 48, call; 49, identifier:start_slice; 50, identifier:end_slice; 51, identifier:step; 52, identifier:self; 53, identifier:slice_locs; 54, identifier:start; 55, identifier:end; 56, keyword_argument; 57, keyword_argument; 58, identifier:start_slice; 59, identifier:AssertionError; 60, argument_list; 61, identifier:end_slice; 62, identifier:AssertionError; 63, argument_list; 64, identifier:step; 65, identifier:step; 66, identifier:kind; 67, identifier:kind; 68, string:"Start slice bound is non-scalar"; 69, string:"End slice bound is non-scalar"
code: def slice_indexer(self, start=None, end=None, step=None, kind=None):
          """
          For an ordered or unique index, compute the slice indexer for input
          labels and step.
  
          Parameters
          ----------
          start : label, default None
              If None, defaults to the beginning
          end : label, default None
              If None, defaults to the end
          step : int, default None
          kind : string, default None
  
          Returns
          -------
          indexer : slice
  
          Raises
          ------
          KeyError : If key does not exist, or key is not unique and index is
              not ordered.
  
          Notes
          -----
          This function assumes that the data is sorted, so use at your own peril
  
          Examples
          ---------
          This is a method on all index types. For example you can do:
  
          >>> idx = pd.Index(list('abcd'))
          >>> idx.slice_indexer(start='b', end='c')
          slice(1, 3)
  
          >>> idx = pd.MultiIndex.from_arrays([list('abcd'), list('efgh')])
          >>> idx.slice_indexer(start='b', end=('c', 'g'))
          slice(1, 3)
          """
          start_slice, end_slice = self.slice_locs(start, end, step=step,
                                                   kind=kind)
  
          # return a slice
          if not is_scalar(start_slice):
              raise AssertionError("Start slice bound is non-scalar")
          if not is_scalar(end_slice):
              raise AssertionError("End slice bound is non-scalar")
  
          return slice(start_slice, end_slice, step)