code: def create_default_local_save_plan(
      state_dict: Dict[str, Any], is_coordinator: bool
  ) -> SavePlan:
      """
      Create the ``SavePlan`` used by DefaultSavePlanner.
  
      On non-coordinator ranks, this function ignores tensors and non-tensor objects,
      only producing writes for ShardedTensor objects.
  
      On the coordinator rank, produce writes for all values.
      """
      requests = []
      for fqn, obj in state_dict.items():
          # Since DTensor supports submesh, adding extra check to ensure _create_write_items()
          # gets called only when the current rank is part of the mesh for the corresponding DTensor.
          if isinstance(obj, DTensor):
              if obj.device_mesh.get_coordinate() is not None:
                  requests += _create_write_items(fqn, obj)
          elif isinstance(obj, (torch.Tensor)) or is_coordinator:
              requests += _create_write_items(fqn, obj)
  
      return SavePlan(requests)
  
imports: import dataclasses
  import io
  import logging
  import operator
  from collections import ChainMap
  from functools import reduce
  from typing import Any, cast, Dict, List, Tuple, Union
  import torch
  from torch.distributed._shard._utils import narrow_tensor_by_index
  from torch.distributed._tensor import DTensor
  from torch.distributed.checkpoint._dedup_tensors import dedup_tensors
  from torch.distributed.checkpoint._nested_dict import FLATTEN_MAPPING, flatten_state_dict
  from torch.distributed.checkpoint._sharded_tensor_utils import _flatten_sharded_tensors
  from torch.distributed.checkpoint._traverse import set_element
  from torch.distributed.checkpoint.metadata import BytesStorageMetadata, ChunkStorageMetadata, Metadata, MetadataIndex, STATE_DICT_TYPE, STORAGE_TYPES, TensorStorageMetadata
  from torch.distributed.checkpoint.planner import LoadPlan, LoadPlanner, ReadItem, SavePlan, SavePlanner, WriteItem, WriteItemType
  from torch.distributed.checkpoint.planner_helpers import _create_default_metadata_only_plan, _create_read_items, _create_write_items, _init_state_dict
  from torch.distributed.checkpoint.utils import find_state_dict_object
label_desc: Use image node_id 3 for calling a global function with example usage: create_default_local_save_plan(state_dict, is_coordinator) and returns: SavePlan