code: def test_metrics_reset_after_save(tmp_path):
      logger = CSVLogger(tmp_path, flush_logs_every_n_steps=2)
      metrics = {"test": 1}
      logger.log_metrics(metrics, step=0)
      assert logger.experiment.metrics
      logger.log_metrics(metrics, step=1)  # flush triggered
      assert not logger.experiment.metrics
  
imports: import os
  from unittest.mock import MagicMock
  import fsspec
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.core.saving import load_hparams_from_yaml
  from lightning.pytorch.loggers import CSVLogger
  from lightning.pytorch.loggers.csv_logs import ExperimentWriter
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 10 for calling a global function with example usage: test_metrics_reset_after_save(tmp_path) without return types