class_docstr: Helper class providing methods for saving changes made to an experiment
  if `db_settings` property is set to a non-None value on the instance.
class_docstr_tok: ["Helper","class","providing","methods","for","saving","changes","made","to","an","experiment","if","`","db_settings","`","property","is","set","to","a","non-None","value","on","the","instance","."]
docstr: Saves new trials or update existing trials on given experiment if DB
  settings are set on this `WithDBSettingsBase` instance.
  
  Args:
      experiment: Experiment, on which to save new trials in DB.
      trials: Newly added trials to save.
  
  Returns:
      bool: Whether the trials were saved.
docstr_tok: ["Saves","new","trials","or","update","existing","trials","on","given","experiment","if","DB","settings","are","set","on","this","`","WithDBSettingsBase","`","instance",".","Args",":","experiment",":","Experiment",",","on","which","to","save","new","trials","in","DB",".","trials",":","Newly","added","trials","to","save",".","Returns",":","bool",":","Whether","the","trials","were","saved","."]
code: def _save_or_update_trials_in_db_if_possible(
      self,
      experiment: Experiment,
      trials: List[BaseTrial],
      reduce_state_generator_runs: bool = False,
  ) -> bool:
      """Saves new trials or update existing trials on given experiment if DB
      settings are set on this `WithDBSettingsBase` instance.
  
      Args:
          experiment: Experiment, on which to save new trials in DB.
          trials: Newly added trials to save.
  
      Returns:
          bool: Whether the trials were saved.
      """
      if self.db_settings_set:
          _save_or_update_trials_in_db_if_possible(
              experiment=experiment,
              trials=trials,
              encoder=self.db_settings.encoder,
              decoder=self.db_settings.decoder,
              suppress_all_errors=self._suppress_all_errors,
              reduce_state_generator_runs=reduce_state_generator_runs,
          )
          return True
      return False
  
imports: import re
  import time
  from logging import INFO, Logger
  from typing import Any, Dict, List, Optional, Tuple, Type
  from ax.core.base_trial import BaseTrial
  from ax.core.experiment import Experiment
  from ax.core.generation_strategy_interface import GenerationStrategyInterface
  from ax.core.generator_run import GeneratorRun
  from ax.exceptions.core import IncompatibleDependencyVersion, ObjectNotFoundError, UnsupportedError
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.utils.common.executils import retry_on_exception
  from ax.utils.common.logger import _round_floats_for_logging, get_logger
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 11 for calling the WithDBSettingsBase obj's underlying member method code with example usage: obj._save_or_update_trials_in_db_if_possible(experiment, trials, reduce_state_generator_runs) and returns: False, True