code: def config_from_json(cls, json_obj, ignore_fields=()):
      if getattr(cls, "__EXPANSIBLE__", False):
          component_config = _try_component_config_from_json(
              cls, json_obj
          )
          if component_config:
              return component_config
      parsed_dict = {}
      if not hasattr(cls, "_fields"):
          raise IncorrectTypeError(f"{cls} is not a valid config class")
      cls_name = getattr(cls, "__name__", cls)
      # Non-EXPANSIBLE classes can be found in configs
      cls_name_wo_config = cls_name.split(".")[0]
      unknown_fields = (
          set(json_obj)
          - {f[0] for f in cls.__annotations__.items()}
          - {cls_name_wo_config}
      )
      if unknown_fields:
          cls_fields = {f[0] for f in cls.__annotations__.items()}
          raise ConfigParseError(
              f"Unknown fields for class {cls_name} with fields {cls_fields} \
              detected in config json: {unknown_fields}"
          )
      for field, f_cls in cls.__annotations__.items():
          if field in ignore_fields:
              eprint(
                  f"Info - field: {field} in class: {cls_name} is skipped in",
                  "config_from_json because it's found in the ignore_fields.",
              )
              continue
          value = None
          is_optional = _is_optional(f_cls)
  
          if field not in json_obj:
              if field in cls._field_defaults:
                  # if using default value, no conversion is needed
                  value = cls._field_defaults.get(field)
          else:
              try:
                  value = _value_from_json(f_cls, json_obj[field])
              except ConfigParseError:
                  raise
              except Exception as e:
                  raise ConfigParseError(
                      f"failed to parse {field} to {f_cls} with json payload \
                      {json_obj[field]}"
                  ) from e
          # validate value
          if value is None and not is_optional:
              raise MissingValueError(
                  f"missing value for {field} in class {cls_name} with json {json_obj}"
              )
          parsed_dict[field] = value
  
      return cls(**parsed_dict)
  
imports: from enum import Enum
  from typing import Any, Dict, List, Tuple, Type, Union
  from pytext.common.utils import eprint
  from .component import Registry
  from .config_adapter import upgrade_to_latest
  from .pytext_config import PyTextConfig
label_desc: Use image node_id 13 for calling a global function with example usage: config_from_json(cls, json_obj, ignore_fields) and returns: cls, component_config