code: def fn_with_diet_vars(params):
      """Decorator for graph-building function to use diet variables."""
      params = copy.copy(params)
  
      def dec(fn):
          def wrapped(*args):
              return _fn_with_diet_vars(fn, args, params)
  
          return wrapped
  
      return dec
  
imports: from collections import defaultdict
  import copy
  import math
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import hparam
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling a global function with example usage: fn_with_diet_vars(params) and returns: dec, wrapped, _fn_with_diet_vars