code: def save_state_dict(state_dict: dict, filepath: Path):
      """
      Utility function to save a detector's state dictionary to a filepath using `torch.save`.
  
      Parameters
      ----------
      state_dict
          The state dictionary to save.
      filepath
          Directory to save state dictionary to.
      """
      # Save to disk
      torch.save(state_dict, filepath)
  
imports: from pathlib import Path
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: save_state_dict(state_dict, filepath) without return types