class_docstr: See :func:`~orion.testing.state.BaseOrionState`
class_docstr_tok: ["See",":","func",":","`","~orion.testing.state.BaseOrionState","`"]
docstr: Cleanup after testing
docstr_tok: ["Cleanup","after","testing"]
code: def cleanup(self):
      """Cleanup after testing"""
      if self.initialized:
          self.database.remove("benchmarks", {})
          self.database.remove("experiments", {})
          self.database.remove("trials", {})
          if self.tempfile is not None:
              os.close(self.tempfile)
          _remove(self.tempfile_path)
      self.initialized = False
  
imports: import copy
  import os
  import tempfile
  import yaml
  import orion
  from orion.core.io import experiment_builder
  from orion.core.worker.trial import Trial
  from orion.storage.base import setup_storage, storage_factory
label_desc: Use image node_id 6 for calling the LegacyOrionState obj's underlying member method code with example usage: obj.cleanup() without return types