code: def test_rewrite_graph():
      x, y = vectors("xy")
  
      @graph_rewriter
      def custom_rewrite(fgraph):
          fgraph.replace(x, y, import_missing=True)
  
      x_rewritten = rewrite_graph(x, custom_rewrite=custom_rewrite)
  
      assert x_rewritten is y
  
      x_rewritten = rewrite_graph(
          FunctionGraph(outputs=[x], clone=False),
          custom_rewrite=custom_rewrite,
      )
  
      assert x_rewritten.outputs[0] is y
  
file_path: pytensor/tests/graph/rewriting/test_utils.py
imports: from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.rewriting.basic import graph_rewriter
  from pytensor.graph.rewriting.utils import is_same_graph, rewrite_graph
  from pytensor.tensor.math import neg
  from pytensor.tensor.type import vectors
label_desc: Use image node_id 1 for calling a global function with example usage: test_rewrite_graph() without return types