code: def inline_ofg_expansion(fgraph, node):
      """
      This optimization expands internal graph of OpFromGraph.
      Only performed if node.op.is_inline == True
      Doing so can improve optimization at the cost of compilation speed.
      """
      op = node.op
      if not isinstance(op, OpFromGraph):
          return False
      if not op.is_inline:
          return False
      return clone_replace(
          op.inner_outputs, dict(zip(op.inner_inputs, node.inputs))
      )
  
imports: from collections import OrderedDict
  from collections.abc import Sequence
  from copy import copy
  from functools import partial
  from typing import Optional, cast
  import pytensor.tensor
  from pytensor import function
  from pytensor.compile.function.pfunc import rebuild_collect_shared
  from pytensor.compile.mode import optdb
  from pytensor.compile.sharedvalue import SharedVariable
  from pytensor.configdefaults import config
  from pytensor.gradient import DisconnectedType, Rop, grad
  from pytensor.graph.basic import Apply, Constant, NominalVariable, Variable, graph_inputs, io_connection_pattern
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.null_type import NullType
  from pytensor.graph.op import HasInnerGraph, Op
  from pytensor.graph.replace import clone_replace
  from pytensor.graph.rewriting.basic import in2out, node_rewriter
  from pytensor.graph.utils import MissingInputError
  from pytensor.tensor.rewriting.shape import ShapeFeature
label_desc: Use image node_id 3 for calling a global function with example usage: inline_ofg_expansion(fgraph, node) and returns: clone_replace, False, False