code: def test_file(
      self,
      src,
      expected_keys,
      create_dir=True,
      atomic=True,
      func=None,
      kwargs=None,
  ):
      with tempfile.TemporaryDirectory() as tempdir:
          path = os.path.join(tempdir, "test_ckpt.pt")
          if kwargs is None:
              kwargs = {}
          save_state(
              src=src,
              path=path,
              create_dir=create_dir,
              atomic=atomic,
              func=func,
              **kwargs,
          )
          ckpt = dict(torch.load(path))
          for k in ckpt.keys():
              self.assertIn(k, expected_keys)
  
file_path: MONAI/tests/test_save_state.py
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  import torch
  import torch.optim
  from parameterized import parameterized
  from monai.networks import save_state
label_desc: Use image node_id 1 for calling the TestSaveState obj's underlying member method code with example usage: obj.test_file(src, expected_keys, create_dir, atomic, func, kwargs) without return types