code: def _insert_op(fn, op, name, attr=None):
      """
      Create a node with given attributes, then insert to the target graph in
      given function.
  
      Parameters
      ----------
      fn: SSAFunction
          Function that contains graph to operate on.
      op: str
          Type of the operation for the new node.
      name: str
          Name of the new node.
      attr: dict or None (optional)
          Attributes of the new node.
  
      Returns
      -------
      node: ParsedTFNode
          New node object.
      """
      node = ParsedTFNode()
      node.op = op
      node.name = name
      if attr is not None:
          node.attr = attr
      fn.graph[node.name] = node
      return node
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow2/tf_graph_pass/rewrite_control_flow_functions.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import logging
  from coremltools.converters.mil.frontend.tensorflow.parsed_tf_node import ParsedTFNode
  from coremltools.converters.mil.frontend.tensorflow.basic_graph_ops import disconnect_edge, connect_edge, delete_node, replace_node, replace_dest, connect_edge_at_index
label_desc: Use image node_id 3 for calling a global function with example usage: _insert_op(fn, op, name, attr) and returns: node