code: def _pickle_Function(f):
      # copy of the input storage list
      ins = list(f.input_storage)
      input_storage = []
  
      for (input, indices, inputs), (required, refeed, default) in zip(
          f.indices, f.defaults
      ):
          input_storage.append(ins[0])
          del ins[0]
  
      inputs_data = [x.data for x in f.input_storage]
  
      # HACK to detect aliased storage.
      # This is here because aliased relationships are not [currently]
      # preserved across the pickle operation
      if f.pickle_aliased_memory_strategy != "ignore":
          all_data = input_storage + inputs_data
          for i, d_i in enumerate(all_data):
              for j, d_j in enumerate(all_data):
                  if (
                      (i < j)
                      and isinstance(d_i, np.ndarray)
                      and isinstance(d_j, np.ndarray)
                  ):
                      if np.may_share_memory(d_i, d_j):
                          if f.pickle_aliased_memory_strategy == "warn":
                              warnings.warn(
                                  "aliased relationship between "
                                  f"Function arguments {d_i}, {d_j} "
                                  "will not be preserved by "
                                  "un-pickling operation"
                              )
                          else:
                              raise AliasedMemoryError(d_i, d_j)
      # The user can override trust_input. Our doc tell that.  We should
      # not do that anymore and make sure the Maker have all the
      # information needed.
      rval = (
          _constructor_Function,
          (f.maker, input_storage, inputs_data, f.trust_input),
      )
      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 6 for calling a global function with example usage: _pickle_Function(f) and returns: rval