code: def test_prefix():
      """
      Test `match_prefix`.
      """
      g = compile(r"(hello\ world|something\ else)")
  
      m = g.match_prefix("hello world")
      assert isinstance(m, Match)
  
      m = g.match_prefix("he")
      assert isinstance(m, Match)
  
      m = g.match_prefix("")
      assert isinstance(m, Match)
  
      m = g.match_prefix("som")
      assert isinstance(m, Match)
  
      m = g.match_prefix("hello wor")
      assert isinstance(m, Match)
  
      m = g.match_prefix("no-match")
      assert m.trailing_input().start == 0
      assert m.trailing_input().stop == len("no-match")
  
      m = g.match_prefix("hellotest")
      assert m.trailing_input().start == len("hello")
      assert m.trailing_input().stop == len("hellotest")
  
file_path: catboost/contrib/python/prompt-toolkit/py2/tests/test_regular_languages.py
imports: from __future__ import unicode_literals
  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 3 for calling a global function with example usage: test_prefix() without return types