code: def _test_expect_dimensions(self):
      @expect_dimensions(x=2)
      def foo(x, y):
          return x[0, 0]
  
      self.assertEqual(foo(arange(1).reshape(1, 1), 10), 0)
  
      with self.assertRaises(ValueError) as e:
          foo(arange(1), 1)
      errmsg = str(e.exception)
      expected = (
          "{qualname}() expected a 2-D array for argument 'x', but got"
          " a 1-D array instead.".format(qualname=qualname(foo))
      )
      self.assertEqual(errmsg, expected)
  
      with self.assertRaises(ValueError) as e:
          foo(arange(1).reshape(1, 1, 1), 1)
      errmsg = str(e.exception)
      expected = (
          "{qualname}() expected a 2-D array for argument 'x', but got"
          " a 3-D array instead.".format(qualname=qualname(foo))
      )
      self.assertEqual(errmsg, expected)
  
      with self.assertRaises(ValueError) as e:
          foo(array(0), 1)
      errmsg = str(e.exception)
      expected = (
          "{qualname}() expected a 2-D array for argument 'x', but got"
          " a scalar instead.".format(qualname=qualname(foo))
      )
      self.assertEqual(errmsg, expected)
  
imports: from operator import attrgetter
  from types import FunctionType
  from unittest import TestCase
  from nose_parameterized import parameterized
  from numpy import arange, array, dtype
  import pytz
  from six import PY3
  from catalyst.utils.preprocess import call, preprocess
  from catalyst.utils.input_validation import expect_dimensions, ensure_timezone, expect_element, expect_dtypes, expect_types, optional, optionally
label_desc: Use image node_id 20 for calling the PreprocessTestCase obj's underlying member method code with example usage: obj._test_expect_dimensions() and returns: x