code: def create_read_items_for_chunk_list(
      fqn: str,
      checkpoint_md: TensorStorageMetadata,
      local_chunks: List[ChunkStorageMetadata],
  ) -> List[ReadItem]:
      """
      Create a list of ``ReadItem`` based on the checkpoint and local chunks.
  
      This applies the resharding algorithm and computes the reads needed
      to satisfy ``local_chunks`` with a checkpoint described by ``checkpoint_md``.
  
      Args:
          fqn (str) : The state_dict FQN to pass to ``ReadItem``.
          checkpoint_md (TensorStorageMetadata): metadata for a given tensor
              from a checkpoint.
          local_chunks (List[ChunkStorageMetadata]): Local chunks that needs to be
              loaded.
  
      Returns:
          A list of ``ReadItem`` that will satisfy all input chunks.
      """
      read_items = []
      # this is a naive quadratic algo that can be optimized later
      for idx, shard in enumerate(local_chunks):
          for storage_idx, storage_md in enumerate(
              checkpoint_md.chunks
          ):
              if not _check_shard_metadata_pair_overlap(
                  shard, storage_md
              ):
                  continue
  
              storage_offsets = []
              dest_offsets = []
              lengths = []
              for (
                  dim,
                  offset_for_saved_tensor,
                  offset_for_current_tensor,
                  length,
              ) in _shards_get_overlap_region_wrt_saved_tensor(
                  saved_shard=storage_md, current_shard=shard
              ):
                  storage_offsets.append(offset_for_saved_tensor)
                  dest_offsets.append(offset_for_current_tensor)
                  lengths.append(length)
  
              read_items.append(
                  _create_read_item_for_tensor(
                      dest_index=MetadataIndex(fqn, shard.offsets, idx),
                      dest_offsets=dest_offsets,
                      storage_index=MetadataIndex(
                          fqn, storage_md.offsets, storage_idx
                      ),
                      storage_offsets=storage_offsets,
                      lengths=lengths,
                  )
              )
      return read_items
  
imports: from typing import Any, cast, List
  import torch
  import torch.distributed
  from torch._utils import _get_device_module
  from torch.distributed._shard.metadata import ShardMetadata
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.distributed._shard.sharded_tensor.metadata import TensorProperties
  from torch.distributed._tensor import DTensor
  from torch.distributed._tensor._utils import compute_local_shape_and_global_offset
  from torch.utils._pytree import tree_map_only
  from .metadata import BytesStorageMetadata, ChunkStorageMetadata, MetadataIndex, STATE_DICT_TYPE, STORAGE_TYPES, TensorStorageMetadata
  from .planner import LoadItemType, ReadItem, SavePlan, TensorWriteData, WriteItem, WriteItemType
  from .resharding import _check_shard_metadata_pair_overlap, _shards_get_overlap_region_wrt_saved_tensor
label_desc: Use image node_id 10 for calling a global function with example usage: create_read_items_for_chunk_list(fqn, checkpoint_md, local_chunks) and returns: read_items