def slice_locs(self, start=None, end=None, step=None, kind=None):
inc = (step is None or step >= <NUM_LIT:0>)<EOL>if not inc:<EOL><INDENT>start, end = end, start<EOL><DEDENT>if (isinstance(start, (str, datetime))<EOL>and isinstance(end, (str, datetime))):<EOL><INDENT>try:<EOL><INDENT>ts_start = Timestamp(start)<EOL>ts_end = Timestamp(end)<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if not tz_compare(ts_start.tzinfo, ts_end.tzinfo):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>start_slice = None<EOL>if start is not None:<EOL><INDENT>start_slice = self.get_slice_bound(start, '<STR_LIT:left>', kind)<EOL><DEDENT>if start_slice is None:<EOL><INDENT>start_slice = <NUM_LIT:0><EOL><DEDENT>end_slice = None<EOL>if end is not None:<EOL><INDENT>end_slice = self.get_slice_bound(end, '<STR_LIT:right>', kind)<EOL><DEDENT>if end_slice is None:<EOL><INDENT>end_slice = len(self)<EOL><DEDENT>if not inc:<EOL><INDENT>end_slice, start_slice = start_slice - <NUM_LIT:1>, end_slice - <NUM_LIT:1><EOL>if end_slice == -<NUM_LIT:1>:<EOL><INDENT>end_slice -= len(self)<EOL><DEDENT>if start_slice == -<NUM_LIT:1>:<EOL><INDENT>start_slice -= len(self)<EOL><DEDENT><DEDENT>return start_slice, end_slice<EOL>
Compute slice locations for input labels.

Parameters
----------
start : label, default None
    If None, defaults to the beginning
end : label, default None
    If None, defaults to the end
step : int, defaults None
    If None, defaults to 1
kind : {'ix', 'loc', 'getitem'} or None

Returns
-------
start, end : int

See Also
--------
Index.get_loc : Get location for a single label.

Notes
-----
This method only works if the index is monotonic or unique.

Examples
---------
>>> idx = pd.Index(list('abcd'))
>>> idx.slice_locs(start='b', end='c')
(1, 3)