code: def test_get_loc_non_scalar_errors(self, key):
      # GH 31117
      idx = IntervalIndex.from_tuples(
          [(1, 3), (2, 4), (3, 5), (7, 10), (3, 10)]
      )
  
      msg = str(key)
      with pytest.raises(InvalidIndexError, match=msg):
          idx.get_loc(key)
  
imports: import re
  import numpy
  import pytest
  from pandas.errors import InvalidIndexError
  from pandas import NA, CategoricalIndex, DatetimeIndex, Index, Interval, IntervalIndex, MultiIndex, NaT, Timedelta, Timestamp, array, date_range, interval_range, isna, period_range, timedelta_range
  import pandas._testing
label_desc: Use image node_id 8 for calling the TestGetLoc obj's underlying member method code with example usage: obj.test_get_loc_non_scalar_errors(key) without return types