code: def test_traverse_with_ordered_dict(self) -> None:
      state_dict = OrderedDict(
          {
              "key0": [
                  99,
                  torch.tensor([3]),
              ]
          }
      )
  
      data = {}
  
      def collect_data(path, value):
          nonlocal data
          data[path] = value
  
      _traverse.traverse_state_dict(state_dict, collect_data)
  
      self.assertIn(("key0", 0), data)
      self.assertEqual(data[("key0", 0)], 99)
  
      self.assertIn(("key0", 1), data)
      self.assertEqual(data[("key0", 1)], torch.tensor([3]))
  
file_path: pytorch/test/distributed/checkpoint/test_traverse.py
imports: from collections import OrderedDict
  import torch
  import torch.distributed.checkpoint._traverse
  from torch.distributed.checkpoint.metadata import STATE_DICT_TYPE
  from torch.testing._internal.common_utils import run_tests, TestCase
label_desc: Use image node_id 5 for calling the TestTraverse obj's underlying member method code with example usage: obj.test_traverse_with_ordered_dict() without return types