code: def test_mp_cache(self):
      items = [[list(range(i))] for i in range(5)]
  
      ds = LMDBDataset(
          items,
          transform=_InplaceXform(),
          cache_dir=self.tempdir,
          lmdb_kwargs={"map_size": 10 * 1024},
      )
      self.assertEqual(
          items, [[[]], [[0]], [[0, 1]], [[0, 1, 2]], [[0, 1, 2, 3]]]
      )
      ds1 = LMDBDataset(
          items,
          transform=_InplaceXform(),
          cache_dir=self.tempdir,
          lmdb_kwargs={"map_size": 10 * 1024},
      )
      self.assertEqual(list(ds1), list(ds))
      self.assertEqual(
          items, [[[]], [[0]], [[0, 1]], [[0, 1, 2]], [[0, 1, 2, 3]]]
      )
  
      ds = LMDBDataset(
          items,
          transform=_InplaceXform(),
          cache_dir=self.tempdir,
          lmdb_kwargs={"map_size": 10 * 1024},
          hash_func=json_hashing,
      )
      self.assertEqual(
          items, [[[]], [[0]], [[0, 1]], [[0, 1, 2]], [[0, 1, 2, 3]]]
      )
      ds1 = LMDBDataset(
          items,
          transform=_InplaceXform(),
          cache_dir=self.tempdir,
          lmdb_kwargs={"map_size": 10 * 1024},
          hash_func=json_hashing,
      )
      self.assertEqual(list(ds1), list(ds))
      self.assertEqual(
          items, [[[]], [[0]], [[0, 1]], [[0, 1, 2]], [[0, 1, 2, 3]]]
      )
  
      self.assertTrue(isinstance(ds1.info(), dict))
  
file_path: MONAI/tests/test_lmdbdataset_dist.py
imports: from __future__ import annotations
  import shutil
  import tempfile
  import unittest
  import numpy
  from monai.data import LMDBDataset, json_hashing
  from monai.transforms import Transform
  from tests.utils import DistCall, DistTestCase, skip_if_windows
label_desc: Use image node_id 3 for calling the TestMPLMDBDataset obj's underlying member method code with example usage: obj.test_mp_cache() without return types