class_docstr: Defines the configuration for generating counterfactuals.
class_docstr_tok: ["Defines","the","configuration","for","generating","counterfactuals","."]
code: def load_result(self, data_directory_path):
      metadata_file_path = data_directory_path / (
          _CommonSchemaConstants.METADATA + FileFormats.JSON
      )
  
      if metadata_file_path.exists():
          with open(metadata_file_path, "r") as result_file:
              metadata = json.load(result_file)
  
          if metadata["version"] == _SchemaVersions.V1:
              cf_schema_keys = _V1SchemaConstants.ALL
          else:
              cf_schema_keys = _V2SchemaConstants.ALL
  
          counterfactual_examples_dict = {}
          for counterfactual_examples_key in cf_schema_keys:
              result_path = data_directory_path / (
                  counterfactual_examples_key + FileFormats.JSON
              )
              with open(result_path, "r") as result_file:
                  counterfactual_examples_dict[
                      counterfactual_examples_key
                  ] = json.load(result_file)
  
          counterfactuals_json_str = json.dumps(
              counterfactual_examples_dict
          )
          self.counterfactual_obj = (
              CounterfactualExplanations.from_json(
                  counterfactuals_json_str
              )
          )
      else:
          self.counterfactual_obj = None
  
      result_path = data_directory_path / (
          CounterfactualConfig.HAS_COMPUTATION_FAILED + FileFormats.JSON
      )
      with open(result_path, "r") as result_file:
          self.has_computation_failed = json.load(result_file)
  
      result_path = data_directory_path / (
          CounterfactualConfig.FAILURE_REASON + FileFormats.JSON
      )
      with open(result_path, "r") as result_file:
          self.failure_reason = json.load(result_file)
  
      result_path = data_directory_path / (
          CounterfactualConfig.IS_COMPUTED + FileFormats.JSON
      )
      with open(result_path, "r") as result_file:
          self.is_computed = json.load(result_file)
  
imports: import json
  import uuid
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import dice_ml
  import jsonschema
  import numpy
  import pandas
  from dice_ml import Dice
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask
  from responsibleai._config.base_config import BaseConfig
  from responsibleai._data_validations import validate_train_test_categories
  from responsibleai._interfaces import CounterfactualData
  from responsibleai._internal.constants import CounterfactualManagerKeys, FileFormats, ListProperties, ManagerNames
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.exceptions import DuplicateManagerConfigException, SchemaErrorException
  from responsibleai.managers.base_manager import BaseManager
  from responsibleai.utils import _find_features_having_missing_values, _measure_time
label_desc: Use image node_id 8 for calling the CounterfactualConfig obj's underlying member method code with example usage: obj.load_result(data_directory_path) without return types