code: def validate_config(config: TaskConfig):
      if "tuner_type" not in config.framework_params:
          raise RuntimeError(
              'framework.yaml does not have a "tuner_type" field.'
          )
      if "limit_type" not in config.framework_params:
          raise RuntimeError(
              'framework.yaml does not have a "limit_type" field.'
          )
      if config.framework_params["limit_type"] not in [
          "time",
          "ntrials",
      ]:
          raise RuntimeError(
              '"limit_type" field must be "time" or "ntrials".'
          )
      if config.framework_params["limit_type"] == "ntrials":
          if "trial_limit" not in config.framework_params:
              raise RuntimeError(
                  'framework.yaml does not have a "limit" field.'
              )
          else:
              try:
                  _ = int(config.framework_params["trial_limit"])
              except:
                  raise RuntimeError(
                      '"trial_limit" field must be an integer.'
                  )
  
file_path: nni/examples/trials/benchmarking/automlbenchmark/nni/extensions/NNI/exec.py
imports: import logging
  from .tuners import NNITuner
  from .run_experiment import *
  from amlb.benchmark import TaskConfig
  from amlb.data import Dataset
  from amlb.results import save_predictions_to_file
  from amlb.utils import Timer
label_desc: Use image node_id 1 for calling a global function with example usage: validate_config(config) without return types