code: def test_grammar_from_string():
      grammar = llama_cpp.LlamaGrammar.from_string(tree)
      assert grammar._n_rules == 3
      assert grammar._start_rule_index == 2
      assert grammar.grammar is not None
  
imports: import llama_cpp
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: test_grammar_from_string() without return types