code: def _test_optionally(self):
      error = TypeError("arg must be int")
  
      def preprocessor(func, argname, arg):
          if not isinstance(arg, int):
              raise error
          return arg
  
      @preprocess(a=optionally(preprocessor))
      def f(a):
          return a
  
      self.assertIs(f(1), 1)
      self.assertIsNone(f(None))
  
      with self.assertRaises(TypeError) as e:
          f("a")
      self.assertIs(e.exception, error)
  
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 19 for calling the PreprocessTestCase obj's underlying member method code with example usage: obj._test_optionally() and returns: arg, a