code: def check_union(schema: dict, path: str, ctx: LintContext) -> Errors:
      if "union" not in schema:
          return []
  
      errors = []
  
      for idx, sub in enumerate(schema["union"]["items"]):
          subpath = path + f"union.items.[{idx}]"
          if not isinstance(sub, dict):
              errors.append((subpath, "is not a json object"))
              continue
          if "unionKey" not in sub:
              errors.append((subpath, "has no unionKey"))
              continue
          if not isinstance(sub["unionKey"], str):
              errors.append((subpath, "unionKey is not a string"))
              continue
  
      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 10 for calling a global function with example usage: check_union(schema, path, ctx) and returns: errors, list