code: def get_function(name, entries):
      """Generates lookup function with given name and lookup table entries."""
      contents = """
  absl::optional<tensorflow::gtl::FlatSet<int>> {name}(
      const tensorflow::string &op_name) {{
    static std::array<OpIndexInfo, {count}> a = {{{{
  """.format(
          name=name, count=len(entries) + 1
      )
      contents += "      "
      contents += "\n      ".join(
          entries[op_type] for op_type in sorted(entries)
      )
      contents += '\n      {"VarHandleOp"},'
      contents += """
    }};
    static const auto &m = *OpGradientInfoInit(a);
  
    auto it = m.find(op_name);
    if (it != m.end()) {
      return it->second;
    }
    return absl::nullopt;
  }
  """
      return contents
  
imports: import sys
  import gast
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import cfg
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
  from tensorflow.python.autograph.pyct import transformer
  from tensorflow.python.autograph.pyct.static_analysis import activity
  from tensorflow.python.autograph.pyct.static_analysis import liveness
  from tensorflow.python.autograph.pyct.static_analysis import reaching_fndefs
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
label_desc: Use image node_id 4 for calling a global function with example usage: get_function(name, entries) and returns: contents