code: def iter_schema(
      schema: dict,
      path: str,
      ctx: Optional[LintContext] = None,
      in_checks: bool = False,
      filepath: Optional[str] = None,
  ) -> Errors:
      """
      Iterate through structural elements of a schema.  In the following example:
  
          {
              "type": "string",
              "required": ["meh"],
              "additionalProperties": false,
              "properties": {
                  "meh": { "const": "some_val" }
              }
          }
  
      ... the root object, the `false`, and the `{ "const": "some_val" }` are each structural.
  
      Everthing else is content-related and non-structural.
      """
  
      if not isinstance(schema, (dict, bool)):
          return [(path, "schema should be a dictionary or a bool")]
  
      # True or False are special.
      if isinstance(schema, bool):
          return []
  
      errors = []
  
      # Apply linters to this structural element.
      if ctx is None:
          assert filepath, "filepath must be provided when ctx is None"
          ctx = LintContext(
              schema,
              path,
              toplevel=True,
              in_checks=in_checks,
              filepath=filepath,
          )
      else:
          ctx = LintContext(
              schema, path, False, ctx.in_checks, ctx.filepath
          )
      for linter in linters:
          try:
              errors += linter(schema, path, ctx)
          except Exception as e:
              raise ValueError(
                  f"error processing schema:\n{json.dumps(schema, indent=4)}"
              ) from e
  
      # Descend into child dicts of structural elements.
      for kw in ["properties"]:
          errors += iter_subdict(schema, path, kw, ctx)
  
      for kw in ["checks"]:
          ctx.in_checks = True
          errors += iter_subdict(schema, path, kw, ctx)
  
      # Descend into child lists of structural elements.
      for kw in ["oneOf", "anyOf", "allOf"]:
          errors += iter_sublist(schema, path, kw, ctx)
  
      # Descend directly into child structural elements.
      for kw in ["items", "additionalProperties", "not"]:
          errors += iter_subschema(schema, path, kw, ctx)
  
      # Descend into custom structural elements.
      errors += iter_union(schema, path, ctx)
  
      return errors
  
imports: import argparse
  import json
  import os
  import re
  import sys
  from typing import Callable, List, Optional, Tuple, TypeVar, Union
label_desc: Use image node_id 17 for calling a global function with example usage: iter_schema(schema, path, ctx, in_checks, filepath) and returns: errors, list, list