code: def gen_var_name(ops):
      if not isinstance(ops, list):
          ops = [ops]
      for op in ops:
          var = op.get_defining_op()
          if var in var_name:
              return var_name[var]
          else:
              try:
                  name = op.name
              except ValueError:
                  name = "tmp_var_" + str(var_idx[0])
                  var_idx[0] += 1
              var_name[var] = name
              return var_name[var]
  
imports: from collections import Counter
  from collections import deque
label_desc: Use image node_id 1 for calling a global function with example usage: gen_var_name(ops) and returns: var_name, var_name