code: def test_local_Unique_scalar(
      return_index, return_counts, return_inverse
  ):
      x = dscalar()
      y = unique(
          x,
          return_index=return_index,
          return_counts=return_counts,
          return_inverse=return_inverse,
          axis=None,
      )
  
      y_fg = FunctionGraph(outputs=[y], copy_inputs=False)
      y_rewritten_fg = rewrite_graph(
          y_fg,
          clone=False,
          include=["canonicalize", "local_Unique_scalar"],
      )
      y_rewritten = y_rewritten_fg.outputs[0]
      y_rewritten_start = y_rewritten
  
      assert isinstance(y_rewritten_start.owner.op, DimShuffle)
      assert y_rewritten_start.owner.inputs[0] == x
  
      default_mode = get_default_mode()
      rewrite_mode = default_mode.excluding("local_Unique_scalar")
      y_fn = function([x], [y, y_rewritten], mode=rewrite_mode)
  
      x_val = np.array(-10.0, dtype=np.float64)
      y_exp_val, y_val = y_fn(x_val)
      assert np.array_equal(y_exp_val, y_val)
  
file_path: pytensor/tests/tensor/rewriting/test_extra_ops.py
imports: import numpy
  import pytest
  import pytensor.scalar
  from pytensor.compile.function import function
  from pytensor.compile.mode import OPT_NONE, Mode, get_default_mode
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.rewriting.utils import rewrite_graph
  from pytensor.tensor.basic import Alloc, alloc, as_tensor_variable, second
  from pytensor.tensor.elemwise import DimShuffle, Elemwise
  from pytensor.tensor.extra_ops import Repeat, Unique, repeat, unique
  from pytensor.tensor.type import dscalar
label_desc: Use image node_id 1 for calling a global function with example usage: test_local_Unique_scalar(return_index, return_counts, return_inverse) without return types