code: def _validate_export_json_config(export_json_config):
      """Validate if the input export_json_config (PyTextConfig in JSON object) only has
      export section config and a version number.
      """
      assert (
          export_json_config.keys()
          <= {"export", "version", "read_chunk_size"}
      ) or (
          export_json_config.keys()
          <= {"export_list", "version", "read_chunk_size"}
      ), (
          "The export-json config should only contain fields (export or export_list),  version and read_chunk_size. Got "
          f"{export_json_config.keys()}"
      )
  
      if "export" in export_json_config.keys():
          for key in export_json_config["export"]:
              assert (
                  key in ExportConfig.__annotations__.keys()
              ), f"Field {key} in the export json is not found in the ExportConfig class."
      else:  # export_list instead of export
          assert "export_list" in export_json_config.keys()
          found_model_type = None
          export_cfgs = export_json_config["export_list"]
          for export_config in export_cfgs:
              for key in export_config:
                  assert (
                      key in ExportConfig.__annotations__.keys()
                  ), f"Field {key} in the export json is not found in the ExportConfig class."
              this_model_type = (
                  ModelType.PYTORCH
                  if "export_pytorch_path" in export_config
                  else ModelType.CAFFE2
              )
              assert (found_model_type is None) or (
                  found_model_type == this_model_type
              )
              if found_model_type is None:
                  found_model_type = this_model_type
  
imports: import json
  import pprint
  import sys
  import tempfile
  from importlib import import_module
  from pydoc import locate
  from typing import Dict, List, Optional, Union
  import click
  import torch
  from pytext import create_predictor
  from pytext.builtin_task import add_include
  from pytext.common.utils import eprint
  from pytext.config import ExportConfig, LATEST_VERSION, PyTextConfig
  from pytext.config.component import register_tasks
  from pytext.config.config_adapter import upgrade_to_latest
  from pytext.config.serialize import config_from_json, config_to_json, parse_config, pytext_config_from_json
  from pytext.config.utils import find_param, replace_param
  from pytext.data.data_handler import CommonMetadata
  from pytext.metric_reporters.channel import Channel, TensorBoardChannel
  from pytext.PreprocessingMap.ttypes import ModelType
  from pytext.task import load
  from pytext.utils.documentation import find_config_class, get_subclasses, pretty_print_config_class, replace_components, ROOT_CONFIG
  from pytext.utils.file_io import PathManager
  from pytext.workflow import export_saved_model_to_caffe2, export_saved_model_to_torchscript, get_logits, prepare_task_metadata, save_pytext_snapshot, test_model_from_snapshot_path, train_model
  from torch.multiprocessing.spawn import spawn
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_export_json_config(export_json_config) without return types