code: def test_variable_varname():
      """
      Test `Variable` with varname.
      """
      g = compile("((?P<varname>hello|world)|test)")
  
      m = g.match("hello")
      variables = m.variables()
      assert isinstance(variables, Variables)
      assert variables.get("varname") == "hello"
      assert variables["varname"] == "hello"
  
      m = g.match("world")
      variables = m.variables()
      assert isinstance(variables, Variables)
      assert variables.get("varname") == "world"
      assert variables["varname"] == "world"
  
      m = g.match("test")
      variables = m.variables()
      assert isinstance(variables, Variables)
      assert variables.get("varname") is None
      assert variables["varname"] is None
  
file_path: catboost/contrib/python/prompt-toolkit/py3/tests/test_regular_languages.py
imports: from __future__ import annotations
  from prompt_toolkit.completion import CompleteEvent, Completer, Completion
  from prompt_toolkit.contrib.regular_languages import compile
  from prompt_toolkit.contrib.regular_languages.compiler import Match, Variables
  from prompt_toolkit.contrib.regular_languages.completion import GrammarCompleter
  from prompt_toolkit.document import Document
label_desc: Use image node_id 2 for calling a global function with example usage: test_variable_varname() without return types