code: def check_nullable(
      schema: dict, path: str, ctx: LintContext
  ) -> Errors:
      """Non-Required fields must be nullable; required fields must be non-Nullable."""
      if ctx.in_checks:
          return []
      if not isinstance(schema, dict) or "properties" not in schema:
          return []
  
      errors = []
  
      for key, sub in schema["properties"].items():
          if sub is True:
              # Don't complain about the universal match (true).
              continue
          subpath = path + f".{key}"
          # Make sure that nullability matches the requiredness.
          if is_required(schema, key) and is_nullable(schema, key):
              errors.append((subpath, "required property is nullable"))
          if not is_required(schema, key) and not is_nullable(
              schema, key
          ):
              errors.append(
                  (subpath, "non-required property is not nullable")
              )
          # Make sure that $refs are optional on nullable objects.
          if is_nullable(schema, key) and "$ref" in sub:
              errors.append(
                  (subpath, "nullable $ref should be an optionalRef")
              )
          if not is_nullable(schema, key) and "optionalRef" in sub:
              errors.append(
                  (
                      subpath,
                      "non-nullable optionalRef should be a plain $ref",
                  )
              )
  
      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 8 for calling a global function with example usage: check_nullable(schema, path, ctx) and returns: errors, list, list