code: def test_RewriteRule():
      # Test extraneous vars are removed, varlist is correct
      assert rule1.vars == ("a",)
      assert rule1._varlist == ["a"]
      assert rule2.vars == ("a",)
      assert rule2._varlist == ["a", "a"]
      assert rule3.vars == ("a",)
      assert rule3._varlist == ["a", "a"]
      assert rule4.vars == ("a", "b")
      assert rule4._varlist == ["b", "a"]
      assert rule5.vars == ("a", "b", "c")
      assert rule5._varlist == ["c", "b", "a"]
  
file_path: lightning-flash/tests/core/serve/test_dag/test_rewrite.py
imports: import pytest
  from flash.core.serve.dag.rewrite import VAR, RewriteRule, RuleSet, Traverser, args, head
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 8 for calling a global function with example usage: test_RewriteRule() without return types