code: def add_rule(
      state: parse_state,
      rule_id: int,
      rule: std.vector[LlamaGrammarElement],
  ) -> None:
      if state.rules.size() <= rule_id:
          state.rules.resize(
              rule_id + 1,
              fill_value_factory=std.vector[LlamaGrammarElement],
          )
      state.rules[rule_id] = rule
  
imports: from pathlib import Path
  import sys
  from ctypes import *
  from enum import Enum
  from itertools import islice
  from typing import Any, Callable, Dict, Generic, List, Optional, OrderedDict, TextIO, Tuple, TypeVar, Union, overload
  import llama_cpp.llama_cpp
  import json
  import re
  from typing import List, Optional
label_desc: Use image node_id 3 for calling a global function with example usage: add_rule(state, rule_id, rule) without return types