code: def test_load_with_world_size_diff_by_one(self):
      def create_state_dict(rank, world_size):
          with with_dist(rank=rank, world_size=world_size):
              return {
                  "st": create_sharded_tensor(
                      rank=rank,
                      world_size=world_size,
                      shards_per_rank=1,
                      shard_size=120 // world_size,
                  )
              }
  
      # rank 1 has a 30 bytes shard from [30, 60[
      world4_state_dict = create_state_dict(rank=1, world_size=4)
      world4_metadata = _create_default_local_metadata(
          world4_state_dict
      )
  
      # rank 1 has a 40 bytes shard from [40, 80[
      world3_state_dict = create_state_dict(rank=1, world_size=3)
  
      load_plan = create_default_local_load_plan(
          world3_state_dict, world4_metadata
      )
      self.assertEqual(2, len(load_plan.items))
      # this is [30, 60] to load [40, 60]
      low_ri = next(
          ri
          for ri in load_plan.items
          if ri.dest_offsets == torch.Size([0])
      )
      # this is [60, 90] to load [60, 80]
      high_ri = next(
          ri
          for ri in load_plan.items
          if ri.dest_offsets == torch.Size([20])
      )
  
      self.assertEqual(low_ri.storage_index, MetadataIndex("st", [30]))
      self.assertEqual(low_ri.storage_offsets, torch.Size([10]))
      self.assertEqual(low_ri.dest_index, MetadataIndex("st", [40]))
      self.assertEqual(low_ri.dest_offsets, torch.Size([0]))
      self.assertEqual(low_ri.lengths, torch.Size([20]))
  
      self.assertEqual(high_ri.storage_index, MetadataIndex("st", [60]))
      self.assertEqual(high_ri.storage_offsets, torch.Size([0]))
      self.assertEqual(high_ri.dest_index, MetadataIndex("st", [40]))
      self.assertEqual(high_ri.dest_offsets, torch.Size([20]))
      self.assertEqual(high_ri.lengths, torch.Size([20]))
  
imports: import sys
  import torch
  from torch.distributed._shard.sharded_tensor import Shard, ShardedTensor, ShardedTensorMetadata, ShardMetadata
  from torch.distributed._shard.sharded_tensor.metadata import TensorProperties
  from torch.distributed.checkpoint._dedup_tensors import dedup_tensors
  from torch.distributed.checkpoint.default_planner import _create_default_local_metadata, create_default_global_save_plan, create_default_local_load_plan, create_default_local_save_plan
  from torch.distributed.checkpoint.metadata import BytesStorageMetadata, ChunkStorageMetadata, MetadataIndex, TensorStorageMetadata
  from torch.distributed.checkpoint.planner import LoadItemType, WriteItemType
  from torch.distributed.checkpoint.planner_helpers import create_read_items_for_chunk_list
  from torch.testing._internal.common_utils import run_tests, TEST_WITH_DEV_DBG_ASAN, TestCase
  from torch.testing._internal.distributed.distributed_utils import with_dist, with_fake_comms
label_desc: Use image node_id 5 for calling the TestSavePlan obj's underlying member method code with example usage: obj.test_load_with_world_size_diff_by_one() and returns: dict