code: def last_producer(ops, blob):
      for i, op in reversed(list(enumerate(ops))):
          if op.output[0] == blob:
              return i
      raise ValueError("Failed to find last producer of blob, %s", blob)
  
imports: import copy
  import logging
  from collections import defaultdict
  import numpy
  from caffe2.python import core, utils
  from caffe2.python.fb import hardcode_scale_zp
label_desc: Use image node_id 9 for calling a global function with example usage: last_producer(ops, blob) and returns: i