code: def check_default_locations(
      schema: dict, path: str, ctx: LintContext
  ) -> Errors:
      """
      This is a bit artificial, but it's much easier to write the defaulting logic if all default
      values are placed in a consistent location.
  
      They should only ever be found at:  <root>.properties.<key>.default
      """
      if not isinstance(schema, dict) or "properties" not in schema:
          return []
  
      errors = []
  
      for key, sub in schema["properties"].items():
          subpath = path + f".{key}"
          if isinstance(sub, dict) and "default" in sub:
              if sub["default"] == "null":
                  errors.append(
                      (
                          subpath + ".default",
                          "default is the literal 'null' string, probable typo",
                      )
                  )
              elif (
                  not re.match("^<[^>]*>\\.[^.]*$", subpath)
                  and sub["default"] is not None
              ):
                  # This is pretty valid in json-schema normally, but it makes reading defaults
                  # out of json-schema (which we need in multiple languages) much harder.
                  errors.append(
                      (
                          subpath + ".default",
                          "non-null default is defined on a subobject",
                      )
                  )
  
      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 7 for calling a global function with example usage: check_default_locations(schema, path, ctx) and returns: errors, list