class_docstr: Test class for running examples.
docstr: Run given configuration, and check JSON results against expected ones.
docstr_tok: ["Run","given","configuration",",","and","check","JSON","results","against","expected","ones","."]
code: def run_configuration_and_check_outputs(self, config_path):
      """Run given configuration, and check JSON results against expected ones."""
      # run this experiment, get the `results_json_path`
      results_json_path = Path(
          run_configuration(config_path, local=True, quiet=True)[0]
      )
  
      # if the results path exists, check the output
      if results_json_path.exists():
          results_json_exp_path = (
              other_dir / "expected" / results_json_path
          )
          with open(results_json_path) as results_json_file:
              results_obj = json.load(results_json_file)[0]
          with open(results_json_exp_path) as results_json_exp_file:
              results_exp_obj = json.load(results_json_exp_file)[0]
  
          # we check a subset of the values, just to make sure
          # that nothing weird is going on with our output
          for key in [
              "train_set_size",
              "test_set_size",
              "learner_name",
              "cv_folds",
              "feature_scaling",
              "grid_score",
              "grid_objective",
              "accuracy",
              "score",
              "pearson",
          ]:
              # we obviously want to skip any keys that we aren't expecting
              if key in results_exp_obj:
                  actual = results_obj[key]
                  expected = results_exp_obj[key]
  
                  # if this is a float, then we check with less precision (4 decimals);
                  # otherwise, we check to make sure things are matching exactly
                  if isinstance(expected, float):
                      self.assertAlmostEqual(actual, expected, places=4)
                  else:
                      self.assertEqual(actual, expected)
  
file_path: skll/tests/test_examples.py
imports: import json
  import subprocess
  import unittest
  from os import environ
  from pathlib import Path
  from shutil import copyfile, copytree, rmtree
  from skll.experiments import run_configuration
  from skll.utils.testing import examples_dir, other_dir
label_desc: Use image node_id 3 for calling the TestExamples obj's underlying member method code with example usage: obj.run_configuration_and_check_outputs(config_path) without return types