code: def parse_schema(s):
      def parse_type(s: str, end_delimiter: str, element_type: str):
          keys: List[str] = []
          values = []
          i = 0
          while i < len(s):
              if s[i] == end_delimiter:
                  if s[:i]:
                      values.append(s[:i])
                  if element_type in [
                      "Array",
                      "Set",
                      "Dict",
                      "Tuple",
                      "Interval",
                  ]:
                      return {"type": element_type, "value": values}, s[
                          i + 1 :
                      ]
                  return {
                      "type": element_type,
                      "value": OrderedDict(zip(keys, values)),
                  }, s[i + 1 :]
  
              if s[i] == ":":
                  keys.append(s[:i])
                  s = s[i + 1 :]
                  i = 0
              elif s[i] == "{":
                  struct, s = parse_type(s[i + 1 :], "}", s[:i])
                  values.append(struct)
                  i = 0
              elif s[i] == "[":
                  arr, s = parse_type(
                      s[i + 1 :], "]", s[:i] if s[:i] else "Array"
                  )
                  values.append(arr)
                  i = 0
              elif s[i] == ",":
                  if s[:i]:
                      values.append(s[:i])
                  s = s[i + 1 :]
                  i = 0
              else:
                  i += 1
  
          raise ValueError(f"End of {element_type} not found")
  
      start_schema_index = s.index("{")
      return parse_type(
          s[start_schema_index + 1 :], "}", s[:start_schema_index]
      )[0]
  
file_path: hail/hail/python/hailtop/hailctl/describe.py
imports: import asyncio
  import orjson
  from typing import List, Optional, Union, Annotated
  from os import path
  from zlib import decompress, MAX_WBITS
  from statistics import median, mean, stdev
  from collections import OrderedDict
  from typer import Option
label_desc: Use image node_id 1 for calling a global function with example usage: parse_schema(s) and returns: parse_type, dict,  s, dict,  s