code: def debug_pipeline(f, debug=False, method="pow", log_prefix=None):
      """Decorator for input pipeline generators that logs examples at intervals."""
      if not debug:
          return f
  
      assert method in ("pow", "every")
  
      @functools.wraps(f)
      def wrapper(*args, **kwargs):
          count = 0
          prefix = log_prefix or f.__name__
          for example in f(*args, **kwargs):
              count += 1
              if method == "every" or (
                  method == "pow" and (count & count - 1 == 0)
              ):
                  logging.info(
                      "%s example[%d] = %r", prefix, count, example
                  )
              yield example
  
      return wrapper
  
imports: import functools
  from absl import logging
  import gin
label_desc: Use image node_id 1 for calling a global function with example usage: debug_pipeline(f, debug, method, log_prefix) and returns: wrapper, f