code: def validate_label(f):
      @wraps(f)
      def wrapper(label, *args, **kwargs):
          is_real_string = isinstance(label, basestring)
          is_literal_string = isinstance(label, Literal) and isinstance(
              label.obj, basestring
          )
          if not is_real_string and not is_literal_string:
              raise TypeError("require string label")
          return f(label, *args, **kwargs)
  
      return wrapper
  
imports: from __future__ import absolute_import
  from builtins import str
  from builtins import zip
  from builtins import range
  from past.builtins import basestring
  from builtins import object
  from functools import partial, wraps
  from .base import DuplicateLabel
  from .pyll.base import Apply, Literal
  from .pyll import scope
  from .pyll import as_apply
label_desc: Use image node_id 1 for calling a global function with example usage: validate_label(f) and returns: wrapper, f