code: def bjam_signature(s):
      if __debug__:
          from inspect import getcallargs
  
          def decorator(fn):
              function_name = fn.__module__ + "." + fn.__name__
  
              def wrapper(*args, **kwargs):
                  callargs = getcallargs(fn, *args, **kwargs)
                  for field in s:
                      for var, type_ in get_next_var(field):
                          try:
                              value = callargs[var]
                          except KeyError:
                              raise Exception(
                                  'Bjam Signature specifies a variable named "{}"\n'
                                  "but is not found within the python function signature\n"
                                  "for function {}()".format(
                                      var, function_name
                                  )
                              )
                          if not bjam_types[type_](value):
                              raise TypeError(
                                  message.format(
                                      var,
                                      function_name,
                                      type(type_),
                                      repr(value),
                                      bjam_to_python[type_],
                                  )
                              )
                  return fn(*args, **kwargs)
  
              wrapper.__name__ = fn.__name__
              wrapper.bjam_signature = s
              return wrapper
  
          return decorator
      else:
  
          def decorator(f):
              f.bjam_signature = s
              return f
  
      return decorator
  
imports: import bjam
  import re
  import types
  from itertools import groupby
label_desc: Use image node_id 6 for calling a global function with example usage: bjam_signature(s) and returns: decorator, decorator, wrapper, f, fn