code: def test_basic():
      a = te.var("a")
      b = te.var("b")
      m = tvm.arith.detect_linear_equation(a * 4 + b * 6 + 7, [a])
      assert m[0].value == 4
      tvm.testing.assert_prim_expr_equal(m[1], b * 6 + 7)
  
      m = tvm.arith.detect_linear_equation(
          a * 4 * (a + 1) + b * 6 + 7, [a]
      )
      assert len(m) == 0
  
      m = tvm.arith.detect_linear_equation(
          a * 4 + (a + 1) + b * 6 + 7, [a]
      )
      assert m[0].value == 5
      tvm.testing.assert_prim_expr_equal(m[1], b * 6 + 7 + 1)
  
      m = tvm.arith.detect_linear_equation(a * b + 7, [a])
      assert m[0] == b
  
      m = tvm.arith.detect_linear_equation(b * 7, [a])
      assert m[0].value == 0
  
      m = tvm.arith.detect_linear_equation(b * 7, [])
      assert len(m) == 1
      tvm.testing.assert_prim_expr_equal(m[0], b * 7)
  
      c = te.var("c", "uint32")
      m = tvm.arith.detect_linear_equation(128 - c, [c])
      assert m[0].value == -1
  
imports: import tvm
  import tvm.testing
  from tvm import te
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic() without return types