code: def _calculate_cw_shard_sizes_and_offsets(
      columns: int,
      rows: int,
      col_wise_shard_dim: Optional[int] = None,
  ) -> Tuple[List[List[int]], List[List[int]]]:
      block_size: int = min(
          _find_base_dim(col_wise_shard_dim, columns)
          if col_wise_shard_dim
          else _find_base_dim(MIN_CW_DIM, columns),
          columns,
      )
  
      if columns % block_size != 0:
          warnings.warn(
              f"Dim of {columns} cannot be evenly divided with column wise shard"
              "dim {col_wise_shard_dim}, overriding block_size to embedding_dim={columns}",
              UserWarning,
          )
          block_size = columns
  
      num_col_wise_shards, _residual = divmod(columns, block_size)
  
      shard_sizes: List[List[int]] = [
          [rows, block_size]
      ] * num_col_wise_shards
      shard_offsets: List[List[int]] = [
          [0, block_size * rank] for rank in range(num_col_wise_shards)
      ]
      return shard_sizes, shard_offsets
  
imports: import math
  import warnings
  from typing import Callable, cast, Dict, List, Optional, Tuple, Type
  import torch
  from torch import distributed, nn
  from torchrec.distributed.comm import get_local_size
  from torchrec.distributed.embedding import EmbeddingCollectionSharder
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.embeddingbag import EmbeddingBagCollectionSharder
  from torchrec.distributed.fp_embeddingbag import FeatureProcessedEmbeddingBagCollectionSharder
  from torchrec.distributed.fused_embeddingbag import FusedEmbeddingBagCollectionSharder
  from torchrec.distributed.mc_embedding import ManagedCollisionEmbeddingCollectionSharder
  from torchrec.distributed.mc_embeddingbag import ManagedCollisionEmbeddingBagCollectionSharder
  from torchrec.distributed.planner.constants import MIN_CW_DIM
  from torchrec.distributed.quant_embedding import QuantEmbeddingCollectionSharder
  from torchrec.distributed.quant_embeddingbag import QuantEmbeddingBagCollectionSharder
  from torchrec.distributed.types import EmbeddingModuleShardingPlan, EnumerableShardingSpec, ModuleSharder, ParameterSharding, ShardingType, ShardMetadata
  from torchrec.distributed.utils import none_throws
label_desc: Use image node_id 7 for calling a global function with example usage: _calculate_cw_shard_sizes_and_offsets(columns, rows, col_wise_shard_dim) and returns: shard_sizes,  shard_offsets