code: def _create_write_items(fqn: str, object: Any) -> List[WriteItem]:
      if isinstance(object, DTensor):
          return [_create_write_items_for_dtensor(fqn, object)]
      elif isinstance(object, ShardedTensor):
          return [
              _create_write_item_for_shard(fqn, object, shard.metadata)
              for shard in object.local_shards()
          ]
      elif isinstance(object, torch.Tensor):
          return [_create_write_item_for_tensor(fqn, object)]
      else:
          return [_create_write_item_for_bytesio(fqn, object)]
  
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 12 for calling a global function with example usage: _create_write_items(fqn, object) and returns: list, unknown, list, list