code: def infer_reuse_pattern(fgraph, outputs_to_disown):
      """
      Given an fgraph and a list of variables, returns the list or set
      of all variables which may share the same underlying data storage
      as any of the specified variables. Used internally by function,
      FunctionMaker.
  
      This list (or set) is also referred to as no_recycling sometimes,
      especially by linker code.
  
      """
      rval = set()
      for o in outputs_to_disown:
          view_tree_set(fgraph, alias_root(o), rval)
      # remove from rval all of the inputs, constants, values.
      rval = {r for r in rval if r.owner is not None}
  
      return rval
  
imports: import copy
  import copyreg
  import logging
  import time
  import warnings
  from itertools import chain
  from typing import TYPE_CHECKING, Optional
  import numpy
  import pytensor
  import pytensor.compile.profiling
  from pytensor.compile.io import In, SymbolicInput, SymbolicOutput
  from pytensor.compile.ops import deep_copy_op, view_op
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Constant, Variable, ancestors, clone_get_equiv, graph_inputs
  from pytensor.graph.destroyhandler import DestroyHandler
  from pytensor.graph.features import AlreadyThere, Feature, PreserveVariableAttributes
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import HasInnerGraph
  from pytensor.graph.utils import InconsistencyError, get_variable_trace_string
  from pytensor.link.basic import Container
  from pytensor.link.utils import raise_with_op
label_desc: Use image node_id 3 for calling a global function with example usage: infer_reuse_pattern(fgraph, outputs_to_disown) and returns: rval