def _get_join_indexers(self):
def flip(xs):<EOL><INDENT>"""<STR_LIT>"""<EOL>labels = list(string.ascii_lowercase[:len(xs)])<EOL>dtypes = [x.dtype for x in xs]<EOL>labeled_dtypes = list(zip(labels, dtypes))<EOL>return np.array(lzip(*xs), labeled_dtypes)<EOL><DEDENT>left_values = (self.left.index.values if self.left_index else<EOL>self.left_join_keys[-<NUM_LIT:1>])<EOL>right_values = (self.right.index.values if self.right_index else<EOL>self.right_join_keys[-<NUM_LIT:1>])<EOL>tolerance = self.tolerance<EOL>msg_sorted = "<STR_LIT>"<EOL>msg_missings = "<STR_LIT>"<EOL>if not Index(left_values).is_monotonic:<EOL><INDENT>if isnull(left_values).any():<EOL><INDENT>raise ValueError(msg_missings.format(side='<STR_LIT:left>'))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(msg_sorted.format(side='<STR_LIT:left>'))<EOL><DEDENT><DEDENT>if not Index(right_values).is_monotonic:<EOL><INDENT>if isnull(right_values).any():<EOL><INDENT>raise ValueError(msg_missings.format(side='<STR_LIT:right>'))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(msg_sorted.format(side='<STR_LIT:right>'))<EOL><DEDENT><DEDENT>if needs_i8_conversion(left_values):<EOL><INDENT>left_values = left_values.view('<STR_LIT>')<EOL>right_values = right_values.view('<STR_LIT>')<EOL>if tolerance is not None:<EOL><INDENT>tolerance = tolerance.value<EOL><DEDENT><DEDENT>if self.left_by is not None:<EOL><INDENT>if self.left_index and self.right_index:<EOL><INDENT>left_by_values = self.left_join_keys<EOL>right_by_values = self.right_join_keys<EOL><DEDENT>else:<EOL><INDENT>left_by_values = self.left_join_keys[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL>right_by_values = self.right_join_keys[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL><DEDENT>if len(left_by_values) == <NUM_LIT:1>:<EOL><INDENT>left_by_values = left_by_values[<NUM_LIT:0>]<EOL>right_by_values = right_by_values[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>left_by_values = flip(left_by_values)<EOL>right_by_values = flip(right_by_values)<EOL><DEDENT>by_type = _get_cython_type_upcast(left_by_values.dtype)<EOL>by_type_caster = _type_casters[by_type]<EOL>left_by_values = by_type_caster(left_by_values)<EOL>right_by_values = by_type_caster(right_by_values)<EOL>func = _asof_by_function(self.direction)<EOL>return func(left_values,<EOL>right_values,<EOL>left_by_values,<EOL>right_by_values,<EOL>self.allow_exact_matches,<EOL>tolerance)<EOL><DEDENT>else:<EOL><INDENT>func = _asof_function(self.direction)<EOL>return func(left_values,<EOL>right_values,<EOL>self.allow_exact_matches,<EOL>tolerance)<EOL><DEDENT>
return the join indexers