code: def expect_dimensions(__funcname=_qualified_name, **dimensions):
      """
      Preprocessing decorator that verifies inputs are numpy arrays with a
      specific dimensionality.
  
      Examples
      --------
      >>> from numpy import array
      >>> @expect_dimensions(x=1, y=2)
      ... def foo(x, y):
      ...    return x[0] + y[0, 0]
      ...
      >>> foo(array([1, 1]), array([[1, 1], [2, 2]]))
      2
      >>> foo(array([1, 1]), array([1, 1]))  # doctest: +NORMALIZE_WHITESPACE
      ...                                    # doctest: +ELLIPSIS
      Traceback (most recent call last):
         ...
      ValueError: ...foo() expected a 2-D array for argument 'y',
      but got a 1-D array instead.
      """
      if isinstance(__funcname, str):
  
          def get_funcname(_):
              return __funcname
  
      else:
          get_funcname = __funcname
  
      def _expect_dimension(expected_ndim):
          def _check(func, argname, argvalue):
              actual_ndim = argvalue.ndim
              if actual_ndim != expected_ndim:
                  if actual_ndim == 0:
                      actual_repr = "scalar"
                  else:
                      actual_repr = "%d-D array" % actual_ndim
                  raise ValueError(
                      "{func}() expected a {expected:d}-D array"
                      " for argument {argname!r}, but got a {actual}"
                      " instead.".format(
                          func=get_funcname(func),
                          expected=expected_ndim,
                          argname=argname,
                          actual=actual_repr,
                      )
                  )
              return argvalue
  
          return _check
  
      return preprocess(**valmap(_expect_dimension, dimensions))
  
imports: from datetime import tzinfo
  from functools import partial, wraps
  from operator import attrgetter
  from numpy import dtype
  import pandas
  from pytz import timezone
  from six import iteritems, string_types, PY3
  from toolz import valmap, complement, compose
  import toolz.curried.operator
  from catalyst.utils.functional import getattrs
  from catalyst.utils.preprocess import call, preprocess
label_desc: Use image node_id 16 for calling a global function with example usage: expect_dimensions(__funcname) and returns: preprocess, _check, __funcname, argvalue