code: def classify_type(enums: dict, path: str, schema: dict) -> TypeAnno:
      # enforce valid jsonschema:
      assert isinstance(schema, dict), (path, schema)
      if "enum" in schema:
          name = enums[json.dumps(schema["enum"])]
          assert name, (name, schema)
          return Ref(name, url_encodable=True)
  
      if "$ref" in schema:
          ref = schema["$ref"]
          start = "#/definitions/"
          assert ref.startswith(start), ref
          return Ref(ref[len(start) :])
  
      if "type" not in schema:
          # When "type" is not present, any json element should be valid.
          return Any()
  
      # only $refs don't have types
      assert "type" in schema, (path, schema)
  
      if schema["type"] == "string":
          if schema.get("format") == "date-time":
              return DateTime()
          return String()
  
      if schema["type"] == "integer":
          return Int()
  
      if schema["type"] == "boolean":
          return Bool()
  
      if schema["type"] in ("float", "number"):
          return Float()
  
      if schema["type"] == "object" and "properties" not in schema:
          adlProps = schema.get("additionalProperties")
          if adlProps is None:
              return Dict(Any())
          return Dict(
              classify_type(
                  enums, path + ".additionalProperties", adlProps
              )
          )
  
      if schema["type"] == "array":
          items = schema.get("items")
          if items is None:
              raise ValueError(path, schema)
          return Sequence(classify_type(enums, path + ".items", items))
  
      raise ValueError(f"unhandled schema: {schema} @ {path}")
  
imports: import json
  import logging
  import sys
  import typing
  from dataclasses import dataclass, field
  import typing_extensions
label_desc: Use image node_id 1 for calling a global function with example usage: classify_type(enums, path, schema) and returns: Ref, Ref, Any, String, Int, Bool, Float, Dict, Sequence, DateTime, Dict