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
  
file_path: pytorch-lightning/tests/tests_fabric/loggers/test_csv.py
imports: import os
  from unittest.mock import MagicMock
  import pytest
  import torch
  from lightning.fabric.loggers import CSVLogger
  from lightning.fabric.loggers.csv_logs import _ExperimentWriter
label_desc: Use image node_id 9 for calling a global function with example usage: test_metrics_reset_after_save(tmp_path) without return types