code: def validate_file_blacklist(blacklist):
      """Validate contents of blacklist. For most values, the corresponding file is saved upon
      completion of the experiment. See the "Notes" section below for details on some special cases
  
      Parameters
      ----------
      blacklist: List of strings, or None
          The result files that should not be saved
  
      Returns
      -------
      blacklist: List
          If not empty, acceptable list of result file types to blacklist
  
      Notes
      -----
      'heartbeat': If the heartbeat file is saved, a new file is not generated and saved to the
      "Experiments/Heartbeats" directory as is the case with most other files. Instead, the general
      "Heartbeat.log" file is copied and renamed to the current experiment id, then saved to the
      appropriate dir. This is because the general "Heartbeat.log" file represents the heartbeat
      for whatever experiment is currently in progress.
  
      'script_backup': This file is saved as quickly as possible after starting a new experiment,
      rather than waiting for the experiment to end. There are two reasons for this behavior: 1) to
      avoid saving any changes that may have been made to a file after it has been executed, and 2)
      to have the offending file in the event of a catastrophic failure that results in no other
      files being saved. As stated in the documentation of the `file_blacklist` parameter of
      `Environment`, if the path of the file that initializes an Experiment does not end with a ".py"
      extension, the Experiment proceeds as if "script_backup" had been added to `blacklist`. This
      means that backup files will not be created for Jupyter notebooks (or any other non-".py" files)
  
      'description' and 'tested_keys': These two results types constitute a bare minimum of sorts for
      experiment recording. If either of these two are blacklisted, then as far as the library is
      concerned, the experiment never took place.
  
      'tested_keys' (continued): If this string is included in the blacklist, then the contents of the
      "KeyAttributeLookup" directory will also be excluded from the list of files to update
  
      'current_heartbeat': The general heartbeat file that should be stored at
      'HyperparameterHunterAssets/Heartbeat.log'. If this value is blacklisted, then 'heartbeat' is
      also added to `blacklist` automatically out of necessity. This is done because the heartbeat
      file for the current experiment cannot be created as a copy of the general heartbeat file if the
      general heartbeat file is never created in the first place"""
      valid_values = [
          # 'checkpoint',
          "description",
          "heartbeat",
          "predictions_holdout",
          "predictions_in_fold",
          "predictions_oof",
          "predictions_test",
          "script_backup",
          "tested_keys",
          "current_heartbeat",
      ]
      if blacklist == "ALL":
          G.warn(
              'WARNING: Received `blacklist`="ALL". Nothing will be saved'
          )
          return blacklist
  
      if not blacklist:
          return []
      elif not isinstance(blacklist, list):
          raise TypeError(
              "Expected blacklist to be a list, not: {}".format(
                  blacklist
              )
          )
      elif not all([isinstance(_, str) for _ in blacklist]):
          invalid_files = [
              (type(_).__name__, _)
              for _ in blacklist
              if not isinstance(_, str)
          ]
          raise TypeError(
              "Expected blacklist contents to be strings, not: {}".format(
                  invalid_files
              )
          )
  
      for a_file in blacklist:
          if a_file not in valid_values:
              raise ValueError(
                  f"Invalid blacklist value: {a_file}.\nExpected one of: {valid_values}"
              )
          if a_file in ["description", "tested_keys"]:
              G.warn(
                  f"Including {a_file!r} in blacklist will severely impede library functionality"
              )
  
      # Blacklist experiment-specific heartbeat if general (current) heartbeat is blacklisted
      if ("current_heartbeat" in blacklist) and (
          "heartbeat" not in blacklist
      ):
          blacklist.append("heartbeat")
  
      return blacklist
  
imports: from hyperparameter_hunter.callbacks.bases import BaseCallback
  from hyperparameter_hunter.i_o.reporting import ReportingHandler
  from hyperparameter_hunter.keys.makers import CrossExperimentKeyMaker
  from hyperparameter_hunter.metrics import format_metrics
  from hyperparameter_hunter.sentinels import DatasetSentinel
  from hyperparameter_hunter.settings import G, ASSETS_DIRNAME, RESULT_FILE_SUB_DIR_PATHS
  from hyperparameter_hunter.utils.boltons_utils import remap
  from hyperparameter_hunter.utils.file_utils import make_dirs, ParametersFromFile
  from hyperparameter_hunter.utils.general_utils import Alias
  from hyperparameter_hunter.utils.result_utils import format_predictions, default_do_full_save
  from inspect import signature, isclass
  import numpy
  import os.path
  import pandas
  from pandas.api.types import is_numeric_dtype
  from typing import List, Optional, Tuple, Union
  from sklearn.model_selection import _split
label_desc: Use image node_id 2 for calling a global function with example usage: validate_file_blacklist(blacklist) and returns: blacklist, blacklist, list