code: def rebuild_collect_shared(
      outputs: Sequence[Out],
      inputs=None,
      replace=None,
      updates=None,
      rebuild_strict=True,
      copy_inputs_over=True,
      no_default_updates=False,
      clone_inner_graphs=False,
  ) -> tuple[
      list[Variable],
      list[Out],
      tuple[
          dict[Variable, Variable],
          dict[SharedVariable, Variable],
          list[Variable],
          list[SharedVariable],
      ],
  ]:
      ...
  
file_path: pytensor/pytensor/compile/function/pfunc.py
imports: from collections.abc import Sequence
  from copy import copy
  from typing import Optional, Union, overload
  from pytensor.compile.function.types import Function, UnusedInputError, orig_function
  from pytensor.compile.io import In, Out
  from pytensor.compile.profiling import ProfileStats
  from pytensor.compile.sharedvalue import SharedVariable, shared
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Constant, Variable, clone_node_and_cache
  from pytensor.graph.fg import FunctionGraph
label_desc: Use image node_id 4 for calling a global function with example usage: rebuild_collect_shared(outputs, inputs, replace, updates, rebuild_strict, copy_inputs_over, no_default_updates, clone_inner_graphs) without return types