# Buggy code
def _getitem_axis(self, key, axis=0):
    labels = self.obj._get_axis(axis)
    key = self._get_partial_string_timestamp_match_key(key, labels)

    if isinstance(key, slice):
        self._has_valid_type(key, axis)
        return self._get_slice_axis(key, axis=axis)
    elif is_bool_indexer(key):
        return self._getbool_axis(key, axis=axis)
    elif is_list_like_indexer(key):
        # GH 7349
        # possibly convert a list-like into a nested tuple
        # but don't convert a list-like of tuples
        if isinstance(labels, MultiIndex):
            if (
                not isinstance(key, tuple)
                and len(key) > 1
                and not isinstance(key[0], tuple)
            ):
                if isinstance(key, ABCSeries):
                    # GH 14730
                    key = list(key)
                key = tuple([key])

        # an iterable multi-selection
        if not (isinstance(key, tuple) and isinstance(labels, MultiIndex)):
            if hasattr(key, "ndim") and key.ndim > 1:
                raise ValueError("Cannot index with multidimensional key")

            return self._getitem_iterable(key, axis=axis)

        # nested tuple slicing
        if is_nested_tuple(key, labels):
            locs = labels.get_locs(key)
            indexer = [slice(None)] * self.ndim
            indexer[axis] = locs
            return self.obj.iloc[tuple(indexer)]

    # fall thru to straight lookup
    self._has_valid_type(key, axis)
    return self._get_label(key, axis=axis)


# Traceback (KeyError)
In [2]: d = pd.DataFrame([[1, 1, 3],
...:                   [1, 2, 4],
...:                   [2, 2, 5]], columns=['a', 'b', 'c'])

In [3]: d.set_index(['a', 'b']).loc[pd.Series([1, 2])]
Out[3]:
c
a b
1 1  3
2  4
2 2  5

In [4]: d.set_index(['a', 'b']).loc[pd.Series([1, 2], index=[2,0])]
Out[4]:
c
a b
1 1  3
2  4
2 2  5

In [5]: d.set_index(['a', 'b']).loc[pd.Series([1, 2], index=[2,3])]
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-5-a23ad44827f6> in <module>()
----> 1 d.set_index(['a', 'b']).loc[pd.Series([1, 2], index=[2,3])]

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in __getitem__(self, key)
1339         else:
1340             key = com._apply_if_callable(key, self.obj)
-> 1341             return self._getitem_axis(key, axis=0)
1342
1343     def _is_scalar_access(self, key):

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in _getitem_axis(self, key, axis)
1527             if isinstance(labels, MultiIndex):
1528                 if (not isinstance(key, tuple) and len(key) > 1 and
-> 1529                         not isinstance(key[0], tuple)):
1530                     if isinstance(key, ABCSeries):
1531                         # GH 14730

/home/pietro/nobackup/repo/pandas/pandas/core/series.py in __getitem__(self, key)
604         key = com._apply_if_callable(key, self)
605         try:
--> 606             result = self.index.get_value(self, key)
607
608             if not is_scalar(result):

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in get_value(self, series, key)
2304         try:
2305             return self._engine.get_value(s, k,
-> 2306                                           tz=getattr(series.dtype, 'tz', None))
2307         except KeyError as e1:
2308             if len(self) > 0 and self.inferred_type in ['integer', 'boolean']:

/home/pietro/nobackup/repo/pandas/pandas/index.pyx in pandas.index.IndexEngine.get_value (pandas/index.c:3992)()

/home/pietro/nobackup/repo/pandas/pandas/index.pyx in pandas.index.IndexEngine.get_value (pandas/index.c:3689)()

/home/pietro/nobackup/repo/pandas/pandas/index.pyx in pandas.index.IndexEngine.get_loc (pandas/index.c:4688)()

/home/pietro/nobackup/repo/pandas/pandas/src/hashtable_class_helper.pxi in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:13370)()

/home/pietro/nobackup/repo/pandas/pandas/src/hashtable_class_helper.pxi in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:13308)()

KeyError: 0

# Fixed code
def _getitem_axis(self, key, axis=0):
    labels = self.obj._get_axis(axis)
    key = self._get_partial_string_timestamp_match_key(key, labels)

    if isinstance(key, slice):
        self._has_valid_type(key, axis)
        return self._get_slice_axis(key, axis=axis)
    elif is_bool_indexer(key):
        return self._getbool_axis(key, axis=axis)
    elif is_list_like_indexer(key):
        # convert various list-like indexers
        # to a list of keys
        # we will use the *values* of the object
        # and NOT the index if its a PandasObject
        if isinstance(labels, MultiIndex):
            if isinstance(key, (ABCSeries, np.ndarray)) and key.ndim <= 1:
                # Series, or 0,1 ndim ndarray
                # GH 14730
                key = list(key)
            elif isinstance(key, ABCDataFrame):
                # GH 15438
                raise NotImplementedError(
                    "Indexing a MultiIndex with a DataFrame key is not implemented"
                )
            elif hasattr(key, "ndim") and key.ndim > 1:
                raise NotImplementedError(
                    "Indexing a MultiIndex with a "
                    "multidimensional key is not "
                    "implemented"
                )

            if (
                not isinstance(key, tuple)
                and len(key) > 1
                and not isinstance(key[0], tuple)
            ):
                key = tuple([key])

        # an iterable multi-selection
        if not (isinstance(key, tuple) and isinstance(labels, MultiIndex)):
            if hasattr(key, "ndim") and key.ndim > 1:
                raise ValueError("Cannot index with multidimensional key")

            return self._getitem_iterable(key, axis=axis)

        # nested tuple slicing
        if is_nested_tuple(key, labels):
            locs = labels.get_locs(key)
            indexer = [slice(None)] * self.ndim
            indexer[axis] = locs
            return self.obj.iloc[tuple(indexer)]

    # fall thru to straight lookup
    self._has_valid_type(key, axis)
    return self._get_label(key, axis=axis)