code: def has_experiment_result_file(
      results_dir, experiment_id, result_type=None
  ):
      """Check if the specified result files exist in `results_dir` for Experiment `experiment_id`
  
      Parameters
      ----------
      results_dir: String
          HyperparameterHunterAssets directory in which to search for Experiment result files
      experiment_id: String, or BaseExperiment
          ID of the Experiment whose result files should be searched for in `results_dir`. If not
          string, should be an instance of a descendant of
          :class:`~hyperparameter_hunter.experiments.BaseExperiment` with an "experiment_id" attribute
      result_type: List, or string (optional)
          Result file types for which to check. Valid values include any subdirectory name that can be
          included in "HyperparameterHunterAssets/Experiments" by default: ["Descriptions",
          "Heartbeats", "PredictionsOOF", "PredictionsHoldout", "PredictionsTest", "ScriptBackups"].
          If string, should be one of the aforementioned strings, or "ALL" to use all of the results.
          If list, should be a subset of the aforementioned list of valid values. Else, default is
          ["Descriptions", "Heartbeats", "PredictionsOOF", "ScriptBackups"]. The returned boolean
          signifies whether ALL of the `result_type` files were found, not whether ANY were found
  
      Returns
      -------
      Boolean
          True if all result files specified by `result_type` exist in `results_dir` for the
          Experiment specified by `experiment_id`. Else, False"""
      experiment_id = (
          experiment_id
          if isinstance(experiment_id, str)
          else experiment_id.experiment_id
      )
  
      #################### Format `result_type` ####################
      if not result_type:
          result_type = [
              "Descriptions",
              "Heartbeats",
              "PredictionsOOF",
              "ScriptBackups",
          ]
      elif result_type == "ALL":
          result_type = [
              "Descriptions",
              "Heartbeats",
              "PredictionsOOF",
              "PredictionsHoldout",
              "PredictionsTest",
              "ScriptBackups",
          ]
      if isinstance(result_type, str):
          result_type = [result_type]
  
      for subdir in result_type:
          #################### Select Result File Suffix ####################
          if subdir == "Descriptions":
              suffix = ".json"
          elif subdir == "Heartbeats":
              suffix = ".log"
          elif subdir == "ScriptBackups":
              suffix = ".py"
          elif subdir.startswith("Predictions"):
              suffix = ".csv"
          else:
              raise ValueError(
                  f"Cannot resolve suffix for subdir `result_type`: {subdir}"
              )
  
          #################### Check "Experiments" Directory ####################
          if results_dir.endswith("HyperparameterHunterAssets"):
              experiments_dir = Path(results_dir) / "Experiments"
          else:
              experiments_dir = (
                  Path(results_dir)
                  / "HyperparameterHunterAssets"
                  / "Experiments"
              )
  
          if not (
              experiments_dir / subdir / f"{experiment_id}{suffix}"
          ).exists():
              return False
  
      return True
  
imports: from hyperparameter_hunter.feature_engineering import EngineerStep, FeatureEngineer
  from hyperparameter_hunter.i_o.exceptions import IncompatibleCandidateError
  from hyperparameter_hunter.compat.keras_helper import keras_callback_to_dict, keras_initializer_to_dict
  from hyperparameter_hunter.settings import G
  from hyperparameter_hunter.space.dimensions import Categorical, RejectedOptional
  from hyperparameter_hunter.space.space_core import Space
  from hyperparameter_hunter.utils.boltons_utils import remap, get_path
  from hyperparameter_hunter.utils.general_utils import multi_visit
  from hyperparameter_hunter.utils.optimization_utils import does_fit_in_space, get_ids_by, get_scored_params
  from copy import deepcopy
  from numbers import Number
  from pathlib import Path
  from typing import Dict, List, Tuple, Union
  import wrapt
label_desc: Use image node_id 6 for calling a global function with example usage: has_experiment_result_file(results_dir, experiment_id, result_type) and returns: True, False