code: def test_default_metadata(self) -> None:
      device = f"cuda:{dist.get_rank()}"
      spec = ChunkShardingSpec(
          dim=0,
          placements=[
              "rank:0/cuda:0",
              "rank:1/cuda:1",
          ],
      )
  
      state_dict = {
          "sharded": sharded_tensor.rand(
              spec,
              (
                  10,
                  10,
              ),
          ),
          "replicated": torch.rand(4, device=device),
          "bytes": [1, 2, 3, 4],
      }
  
      metadata = _create_default_local_metadata(state_dict)
      self.assertTrue("bytes" in metadata.state_dict_metadata)
      self.assertIsInstance(
          metadata.state_dict_metadata["bytes"], BytesStorageMetadata
      )
  
      self.assertTrue("replicated" in metadata.state_dict_metadata)
      self.assertIsInstance(
          metadata.state_dict_metadata["replicated"],
          TensorStorageMetadata,
      )
      md = metadata.state_dict_metadata["replicated"]
      self.assertEqual(md.size, state_dict["replicated"].size())
      self.assertEqual(md.properties.dtype, torch.float32)
      self.assertEqual(1, len(md.chunks))
  
      self.assertTrue("sharded" in metadata.state_dict_metadata)
      self.assertIsInstance(
          metadata.state_dict_metadata["sharded"], TensorStorageMetadata
      )
      md = metadata.state_dict_metadata["sharded"]
      self.assertEqual(md.properties.dtype, torch.float32)
      self.assertEqual(md.size, state_dict["sharded"].size())
      self.assertEqual(2, len(md.chunks))
  
imports: import sys
  from typing import cast, List, Optional
  import torch
  import torch.distributed
  import torch.futures
  import torch.nn
  from torch.distributed._shard import sharded_tensor
  from torch.distributed._shard.sharded_tensor import ShardedTensor, state_dict_hook
  from torch.distributed._shard.sharding_spec import ChunkShardingSpec
  from torch.distributed.checkpoint import CheckpointException, load_state_dict, save_state_dict, StorageReader, StorageWriter
  from torch.distributed.checkpoint.default_planner import _create_default_local_metadata
  from torch.distributed.checkpoint.metadata import BytesStorageMetadata, Metadata, TensorStorageMetadata
  from torch.distributed.checkpoint.planner import LoadPlan, LoadPlanner, SavePlan, SavePlanner
  from torch.distributed.checkpoint.storage import WriteResult
  from torch.futures import Future
  from torch.testing._internal.common_distributed import requires_nccl, skip_if_lt_x_gpu
  from torch.testing._internal.common_utils import run_tests, TEST_WITH_DEV_DBG_ASAN
  from torch.testing._internal.distributed._shard.sharded_tensor import ShardedTensorTestBase, with_comms
label_desc: Use image node_id 3 for calling the TestDistributedCheckpointing obj's underlying member method code with example usage: obj.test_default_metadata() without return types