code: def test_cache_with_simple_format(tmpdir):
      cache_dir = os.path.join(tmpdir, "cache1")
      os.makedirs(cache_dir)
  
      cache = Cache(cache_dir, chunk_bytes=90)
  
      # you encode data
      for i in range(100):
          cache[i] = i
  
      # I am done, write the index ...
      cache.done()
      cache.merge()
  
      # please, decode the data for me.
      for i in range(100):
          assert i == cache[i]
  
      cache_dir = os.path.join(tmpdir, "cache2")
      os.makedirs(cache_dir)
  
      cache = Cache(cache_dir, chunk_bytes=90)
  
      for i in range(100):
          cache[i] = [i, {0: [i + 1]}]
  
      cache.done()
      cache.merge()
  
      for i in range(100):
          assert [i, {0: [i + 1]}] == cache[i]
  
imports: import json
  import os
  import sys
  from functools import partial
  import numpy
  import pytest
  import torch
  from lightning import seed_everything
  from lightning.data.streaming import Cache
  from lightning.data.streaming.dataloader import CacheDataLoader
  from lightning.data.streaming.dataset import StreamingDataset
  from lightning.data.streaming.item_loader import TokensLoader
  from lightning.data.streaming.serializers import Serializer
  from lightning.data.utilities.env import _DistributedEnv
  from lightning.fabric import Fabric
  from lightning.pytorch.demos.boring_classes import RandomDataset
  from lightning_utilities.core.imports import RequirementCache
  from lightning_utilities.test.warning import no_warning_call
  from torch.utils.data import Dataset
label_desc: Use image node_id 5 for calling a global function with example usage: test_cache_with_simple_format(tmpdir) without return types