code: def json_schema_to_gbnf(
      schema: str, prop_order: Optional[List[str]] = None
  ):
      prop_order = prop_order or []
      schema = json.loads(schema)
      prop_order = {name: idx for idx, name in enumerate(prop_order)}
      converter = SchemaConverter(prop_order)
      converter.visit(schema, "")
      return converter.format_grammar()
  
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 18 for calling a global function with example usage: json_schema_to_gbnf(schema, prop_order) and returns: converter