def get_slice_bound(self, label, side, kind):
assert kind in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', None]<EOL>if side not in ('<STR_LIT:left>', '<STR_LIT:right>'):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(side, ))<EOL><DEDENT>original_label = label<EOL>label = self._maybe_cast_slice_bound(label, side, kind)<EOL>try:<EOL><INDENT>slc = self._get_loc_only_exact_matches(label)<EOL><DEDENT>except KeyError as err:<EOL><INDENT>try:<EOL><INDENT>return self._searchsorted_monotonic(label, side)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise err<EOL><DEDENT><DEDENT>if isinstance(slc, np.ndarray):<EOL><INDENT>if is_bool_dtype(slc):<EOL><INDENT>slc = lib.maybe_booleans_to_slice(slc.view('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>slc = lib.maybe_indices_to_slice(slc.astype('<STR_LIT>'), len(self))<EOL><DEDENT>if isinstance(slc, np.ndarray):<EOL><INDENT>raise KeyError("<STR_LIT>"<EOL>"<STR_LIT>" % (side, original_label))<EOL><DEDENT><DEDENT>if isinstance(slc, slice):<EOL><INDENT>if side == '<STR_LIT:left>':<EOL><INDENT>return slc.start<EOL><DEDENT>else:<EOL><INDENT>return slc.stop<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if side == '<STR_LIT:right>':<EOL><INDENT>return slc + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>return slc<EOL><DEDENT><DEDENT>
Calculate slice bound that corresponds to given label.

Returns leftmost (one-past-the-rightmost if ``side=='right'``) position
of given label.

Parameters
----------
label : object
side : {'left', 'right'}
kind : {'ix', 'loc', 'getitem'}