code: def test_gap_overwrite(self):
      snapshotter = Snapshotter(self.temp_dir.name, "gap_overwrite", 2)
      assert snapshotter.snapshot_dir == self.temp_dir.name
      assert snapshotter.snapshot_mode == "gap_overwrite"
      assert snapshotter.snapshot_gap == 2
  
      snapshot_data = [{"testparam": 1}, {"testparam": 4}]
      snapshotter.save_itr_params(1, snapshot_data[0])
      snapshotter.save_itr_params(2, snapshot_data[1])
  
      filename = osp.join(self.temp_dir.name, "params.pkl")
      assert osp.exists(filename)
      with open(filename, "rb") as pkl_file:
          data = pickle.load(pkl_file)
          assert data == snapshot_data[1]
  
file_path: garage/tests/garage/experiment/test_snapshotter.py
imports: from os import path
  import pickle
  import tempfile
  import pytest
  from garage.experiment import Snapshotter
label_desc: Use image node_id 4 for calling the TestSnapshotter obj's underlying member method code with example usage: obj.test_gap_overwrite() without return types