code: def local_join_make_vector(fgraph, node):
      r"""Merge `MakeVector` inputs within a `Join`.
  
      For example:
  
          Join(0, make_vector1, make_vector2, ...) => Join(0, make_vector12, ...)
  
      This, in combination with the `local_join_1` rewrite, can make `Join`\s
      completely disappear.
      """
      if not isinstance(node.op, Join) or node.outputs[0].ndim != 1:
          return
      new_inputs = [node.inputs[1]]
      for idx in range(2, len(node.inputs)):
          inp = node.inputs[idx]
          if (
              inp.owner
              and isinstance(inp.owner.op, MakeVector)
              and new_inputs[-1].owner
              and isinstance(new_inputs[-1].owner.op, MakeVector)
              and
              # MakeVector have a dtype parameter
              inp.owner.op == new_inputs[-1].owner.op
          ):
              inps = new_inputs[-1].owner.inputs + inp.owner.inputs
              new_inputs[-1] = inp.owner.op(*inps)
  
              # Copy over stacktrace from previous output (after join op)
              # to new intermediate output, because an error in the intermediate
              # op must be caused by an error in the old join op.
              copy_stack_trace(node.outputs, new_inputs[-1])
          else:
              new_inputs.append(inp)
      if len(new_inputs) < len(node.inputs) - 1:
          ret = join(node.inputs[0], *new_inputs)
  
          # Copy over stacktrace from previous output (after join op)
          # to new output, because an error in the new op must be caused
          # by an error in the old join op.
          copy_stack_trace(node.outputs, ret)
          return [ret]
  
imports: import logging
  from typing import Union
  import numpy
  import pytensor.scalar.basic
  from pytensor import compile
  from pytensor.compile.ops import ViewOp
  from pytensor.graph import FunctionGraph
  from pytensor.graph.basic import Constant, Variable
  from pytensor.graph.rewriting.basic import NodeRewriter, RemovalNodeRewriter, Rewriter, copy_stack_trace, in2out, node_rewriter
  from pytensor.graph.rewriting.db import RewriteDatabase
  from pytensor.raise_op import Assert, CheckAndRaise, assert_op
  from pytensor.tensor.basic import Alloc, AllocEmpty, Join, MakeVector, ScalarFromTensor, Split, TensorFromScalar, alloc, as_tensor_variable, cast, extract_constant, fill, get_underlying_scalar_constant_value, join, ones_like, register_infer_shape, switch, tensor_copy, zeros, zeros_like
  from pytensor.tensor.elemwise import DimShuffle, Elemwise
  from pytensor.tensor.exceptions import NotScalarConstantError
  from pytensor.tensor.extra_ops import broadcast_arrays
  from pytensor.tensor.math import Sum, add, eq
  from pytensor.tensor.shape import Shape_i, shape_padleft
  from pytensor.tensor.sort import TopKOp
  from pytensor.tensor.type import DenseTensorType, TensorType
  from pytensor.tensor.variable import TensorConstant, TensorVariable
  from pytensor.utils import NoDuplicateOptWarningFilter
label_desc: Use image node_id 26 for calling a global function with example usage: local_join_make_vector(fgraph, node) and returns: list