def from_dict(cls: Type[ConfigT],
                json_object: Dict[Text, JsonAtomicValue],
                debug_filename: Optional[Text] = None) -> ConfigT:
    """Constructs a `Config` from a Python dictionary of parameters."""
    if not issubclass(cls, Config):
      raise ValueError(
          f"Expected `cls` to be a `Config` class but found '{cls.__name__}'")

    # Create instance of derived class using zero-arg constructor
    config = cls()
    for key, value in json_object.items():
      # Allow special comment key within JSON to make them more readable.
      if key.upper() == "__COMMENT__":
        continue
      # pylint: disable=protected-access
      config._set_value(
          key, value, debug_filename=debug_filename, debug_orig_key=key)
      # pylint: enable=protected-access
    return config
Constructs a `Config` from a Python dictionary of parameters.
language/canine/config_utils.py