code: def validate_type(config: ConfigBase) -> None:
      class_name = type(config).__name__
      for field in dataclasses.fields(config):
          value = getattr(config, field.name)
          # check existense
          if is_missing(value):
              raise ValueError(f"{class_name}: {field.name} is not set")
          if not is_instance(value, field.type):
              raise ValueError(
                  f"{class_name}: type of {field.name} ({repr(value)}) is not {field.type}"
              )
  
imports: from __future__ import annotations
  import copy
  import dataclasses
  import importlib
  import json
  import os.path
  from pathlib import Path
  import socket
  from typing import TYPE_CHECKING, get_type_hints
  import typeguard
  import nni.runtime.config
  from .public import is_missing
label_desc: Use image node_id 9 for calling a global function with example usage: validate_type(config) without return types