code: def type_guard(type1):
      def wrap(f):
          old_f = f.__globals__[f.__name__]
  
          def new_f(arg1, *rest):
              if type1 is ANY_TYPE or isinstance(arg1, type1):
                  variable = f(arg1, *rest)
                  if variable is FALL_THROUGH:
                      return old_f(arg1, *rest)
                  else:
                      return variable
              else:
                  return old_f(arg1, *rest)
  
          new_f.__name__ = f.__name__
  
          def typename(type):
              if isinstance(type, Keyword):
                  return str(type)
              elif isinstance(type, (tuple, list)):
                  return (
                      "(" + ", ".join([x.__name__ for x in type]) + ")"
                  )
              else:
                  return type.__name__
  
          new_f.__doc__ = (
              str(old_f.__doc__)
              + "\n"
              + ", ".join([typename(type) for type in (type1,)])
              + "\n"
              + str(f.__doc__ or "")
          )
          return new_f
  
      return wrap
  
imports: from __future__ import absolute_import, print_function, division
  import linecache
  import sys
  import traceback
  import numpy
  from six import iteritems, integer_types, string_types, with_metaclass
  from six.moves import StringIO
  from theano import config
  from theano.compat import PY3
label_desc: Use image node_id 13 for calling a global function with example usage: type_guard(type1) and returns: wrap, new_f, old_f, str, old_f, variable, unknown, type