code: def gen_register_op(source, method_prefix=None):
      """Parse a python code and emit the TFR functions from a target class."""
      mlir_funcs = [
          op_reg_gen(func)
          for name, func in tf_inspect.getmembers(
              source, tf_inspect.isfunction
          )
          if not method_prefix or name.startswith(method_prefix)
      ]
      headers = r"""
  #include "tensorflow/core/framework/op.h"
  
  namespace tensorflow {
    """
      code = "\n".join(mlir_funcs)
      return headers + code + "}  // namespace tensorflow\n"
  
file_path: tensorflow-upstream/tensorflow/compiler/mlir/tfr/python/op_reg_gen.py
imports: import gast
  from tensorflow.python.autograph.pyct import transformer
  from tensorflow.python.autograph.pyct import transpiler
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 2 for calling a global function with example usage: gen_register_op(source, method_prefix) and returns: unknown