code: def test_basic(self):
      reshape_lift = out2in(local_reshape_to_dimshuffle)
      useless_reshape = out2in(local_useless_reshape)
      x = shared(self.rng.standard_normal((4,)))
      y = shared(self.rng.standard_normal((5, 6)))
      reshape_x = reshape(x, (1, 4))
      reshape_y = reshape(y, (1, 5, 1, 6, 1, 1))
  
      g = FunctionGraph([x, y], [reshape_x, reshape_y], clone=False)
  
      assert equal_computations(
          g.outputs,
          [
              Reshape(2)(x, as_tensor_variable((1, 4), ndim=1)),
              Reshape(6)(
                  y, as_tensor_variable((1, 5, 1, 6, 1, 1), ndim=1)
              ),
          ],
      )
  
      reshape_lift.rewrite(g)
      useless_reshape.rewrite(g)
  
      exp_x = SpecifyShape()(x, 4).dimshuffle("x", 0)
      assert equal_computations([g.outputs[0]], [exp_x])
  
      exp_y = Reshape(2)(
          y, as_tensor_variable((5, 6), ndim=1)
      ).dimshuffle("x", 0, "x", 1, "x", "x")
      assert equal_computations([g.outputs[1]], [exp_y])
  
      assert check_stack_trace(g, ops_to_check=(DimShuffle, Reshape))
  
imports: import copy
  import numpy
  import pytest
  import pytensor.tensor
  from pytensor import shared
  from pytensor.compile.function import function
  from pytensor.compile.mode import get_default_mode, get_mode
  from pytensor.compile.ops import deep_copy_op
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Variable, equal_computations
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import Op
  from pytensor.graph.rewriting.basic import check_stack_trace, node_rewriter, out2in
  from pytensor.graph.rewriting.utils import rewrite_graph
  from pytensor.graph.type import Type
  from pytensor.tensor.basic import alloc, as_tensor_variable
  from pytensor.tensor.elemwise import DimShuffle, Elemwise
  from pytensor.tensor.math import add, exp, maximum
  from pytensor.tensor.rewriting.basic import register_specialize
  from pytensor.tensor.rewriting.shape import ShapeFeature, local_reshape_to_dimshuffle, local_useless_reshape
  from pytensor.tensor.shape import Reshape, Shape_i, SpecifyShape, reshape, shape, specify_shape
  from pytensor.tensor.subtensor import set_subtensor
  from pytensor.tensor.type import fmatrix, iscalar, lscalar, matrix, scalar, tensor, tensor3, tensor4, vector
  from tests import unittest_tools
label_desc: Use image node_id 2 for calling the TestLocalReshapeToDimshuffle obj's underlying member method code with example usage: obj.test_basic() without return types