code: def test_create_undersized_and_oversized_chunk(tmp_path):
      cache = Cache(
          str(tmp_path), chunk_bytes=9000
      )  # target: 9KB chunks
      with no_warning_call(UserWarning):
          cache[0] = np.random.randint(
              0, 10, size=(500,), dtype=np.uint8
          )  # will result in undersized chunk
          cache[1] = np.random.randint(
              0, 10, size=(10000,), dtype=np.uint8
          )  # will result in oversized chunk
      with pytest.warns(
          UserWarning,
          match="An item was larger than the target chunk size",
      ):
          cache[2] = np.random.randint(
              0, 10, size=(150,), dtype=np.uint8
          )
      with no_warning_call(UserWarning):
          cache[3] = np.random.randint(
              0, 10, size=(200,), dtype=np.uint8
          )
  
      cache.done()
      cache.merge()
  
      assert len(os.listdir(tmp_path)) == 4  # 3 chunks + 1 index file
      with open(tmp_path / "index.json") as file:
          index = json.load(file)
  
      chunks = index["chunks"]
      assert chunks[0]["chunk_size"] == 1
      assert chunks[0]["filename"] == "chunk-0-0.bin"
      assert chunks[1]["chunk_size"] == 1
      assert chunks[1]["filename"] == "chunk-0-1.bin"
      assert chunks[2]["chunk_size"] == 2
      assert chunks[2]["filename"] == "chunk-0-2.bin"
  
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 8 for calling a global function with example usage: test_create_undersized_and_oversized_chunk(tmp_path) without return types