code: def test_expression_simplification():
      simp = _expression.expression_simplification
  
      assert _mutable_equal(
          simp(
              nni.choice("a", [2, 3])
              + nni.choice("b", [3, 4])
              - nni.choice("a", [2, 3])
          ),
          nni.choice("b", [3, 4]),
      )
  
      x = nni.choice("x", [32, 64])
      y = nni.choice("y", [3, 5, 7])
      assert _mutable_equal(
          simp(x + 2 * ((y - 1) // 2) - (y - 1) - 1), x - 1
      )
  
      assert _mutable_equal(simp(x - (x + 1)), -1)
      assert isinstance(simp(x - (x + 1)), int)
  
      x = nni.choice("x", [0.0, 1.0, 2.0])
      assert _mutable_equal(
          simp((x + 1) ** 2 - (x * x + 2 * x + 2)), -1
      )
      assert isinstance(simp(x - (x + 1)), float)
  
      x = nni.choice("x", [2, 4, 8])
      assert _mutable_equal(simp(x // 2 - x / 2), 0)
      assert isinstance(simp(x // 2 - x / 2), float)
  
      x = nni.choice("x", [3, 5, 7])
      expr = -x // 2 + (x - 1) // 2 + 1
      assert simp(expr) == 0
  
file_path: nni/test/ut/nas/profiler/test_utils.py
imports: import torch
  from torch import nn
  import nni
  import nni.nas.nn.pytorch
  from nni.mutable import Categorical, frozen_context
  from nni.mutable.mutable import _mutable_equal
  from nni.nas.profiler.pytorch.utils import _attrs, is_leaf_module, _expression
label_desc: Use image node_id 5 for calling a global function with example usage: test_expression_simplification() without return types