code: def try_checkpoint_metadata(self, trial):
          
          if trial._checkpoint.storage == Checkpoint.MEMORY:
              logger.debug("Not saving data for trial w/ memory checkpoint.")
              return
          try:
              logger.debug("Saving trial metadata.")
              self._cached_trial_state[trial.trial_id] = trial.__getstate__()
          except Exception:
              logger.exception("Error checkpointing trial metadata.")
docs: Checkpoints metadata.
  
          Args:
              trial (Trial): Trial to checkpoint.