code: def _calculate_rw_shard_io_sizes(
      batch_sizes: List[int],
      world_size: int,
      input_lengths: List[float],
      shard_sizes: List[List[int]],
      input_data_type_size: int,
      output_data_type_size: int,
      num_poolings: List[float],
      is_pooled: bool,
  ) -> Tuple[List[int], List[int]]:
      batch_inputs = (
          sum(
              [
                  x * y * z
                  for x, y, z in zip(
                      input_lengths, num_poolings, batch_sizes
                  )
              ]
          )
          / world_size
      )
      batch_outputs = (
          sum([x * y for x, y in zip(num_poolings, batch_sizes)])
          if is_pooled
          else batch_inputs
      )
  
      input_sizes = [
          math.ceil(batch_inputs * world_size * input_data_type_size)
          if prod(shard) != 0
          else 0
          for shard in shard_sizes
      ]
      output_sizes = [
          math.ceil(
              batch_outputs
              * world_size
              * shard_sizes[i][1]
              * output_data_type_size
          )
          if prod(shard) != 0
          else 0
          for i, shard in enumerate(shard_sizes)
      ]
  
      return input_sizes, output_sizes
  
imports: import logging
  import math
  from typing import cast, Dict, List, Optional, Tuple, Type
  import torch
  import torchrec.optim
  from torch import nn
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.planner.constants import BATCHED_COPY_PERF_FACTOR, BIGINT_DTYPE, DP_ELEMENTWISE_KERNELS_PERF_FACTOR, FULL_BLOCK_EMB_DIM, HALF_BLOCK_PENALTY, kernel_bw_lookup, QUARTER_BLOCK_PENALTY, UVM_CACHING_RATIO, WEIGHTED_KERNEL_MULTIPLIER
  from torchrec.distributed.planner.types import ParameterConstraints, Perf, PlannerError, ShardEstimator, ShardingOption, Storage, Topology
  from torchrec.distributed.planner.utils import prod, sharder_name
  from torchrec.distributed.types import CacheStatistics, CommOp, ModuleSharder, ShardingType
  from torchrec.modules.embedding_modules import EmbeddingBagCollectionInterface
label_desc: Use image node_id 13 for calling a global function with example usage: _calculate_rw_shard_io_sizes(batch_sizes, world_size, input_lengths, shard_sizes, input_data_type_size, output_data_type_size, num_poolings, is_pooled) and returns: input_sizes,  output_sizes