code: def make_function(
      linker: Linker, unpack_single: bool = True, **kwargs
  ) -> Callable:
      """
      Returns a function that takes values corresponding to the inputs of the
      fgraph used by this L{Linker} and returns values corresponding the the
      outputs of that fgraph. If inplace is True, the calculations will
      operate in the same storage the fgraph uses, else independent storage
      will be allocated for the function.
  
      Parameters
      ----------
      unpack_single : bool
          If `unpack_single` is True (default) and that the function has only one
          output, then that output will be returned. Else, a list or tuple of
          length 1 will be returned.
  
      Examples
      --------
      e = x + y
      fgraph = FunctionGraph([x, y], [e])
      fn = make_function(MyLinker(fgraph), inplace)
      print fn(1.0, 2.0) # 3.0
      print e.data # 3.0 iff inplace == True (else unknown)
  
      """
      thunk, inputs, outputs = linker.make_thunk(**kwargs)
  
      def execute(*args):
          takes = len(inputs)
          got = len(args)
          if got != takes:
              raise TypeError(
                  f"Function call takes exactly {takes} args ({got} given)"
              )
          for arg, variable in zip(args, inputs):
              variable.data = arg
          thunk()
          if unpack_single:
              return to_return_values(
                  [variable.data for variable in outputs]
              )
          else:
              return [variable.data for variable in outputs]
  
      return execute
  
imports: from copy import deepcopy
  from typing import Callable
  import numpy
  import pytensor
  from pytensor.graph import fg
  from pytensor.graph.basic import Apply, Constant, Variable, clone
  from pytensor.graph.op import Op
  from pytensor.graph.type import Type
  from pytensor.link.basic import Container, Linker, PerformLinker, WrapLinker
  from pytensor.tensor.type import scalar
  from pytensor.utils import to_return_values
label_desc: Use image node_id 1 for calling a global function with example usage: make_function(linker, unpack_single) and returns: execute, to_return_values, unknown