code: def _cleanup() -> None:
      for slice_data in _get_energy_slices():
          slice = (
              db.session.query(Slice)
              .filter_by(slice_name=slice_data["slice_title"])
              .first()
          )
          db.session.delete(slice)
  
      metric = (
          db.session.query(SqlMetric)
          .filter_by(metric_name="sum__value")
          .one_or_none()
      )
      if metric:
          db.session.delete(metric)
  
      db.session.commit()
  
file_path: superset/tests/integration_tests/fixtures/energy_dashboard.py
imports: import random
  import pandas
  import pytest
  from sqlalchemy import column, Float, String
  from superset import db
  from superset.connectors.sqla.models import SqlaTable, SqlMetric
  from superset.models.slice import Slice
  from superset.utils.core import get_example_default_schema
  from superset.utils.database import get_example_database
  from tests.integration_tests.dashboard_utils import create_slice, create_table_metadata
  from tests.integration_tests.test_app import app
label_desc: Use image node_id 6 for calling a global function with example usage: _cleanup() without return types