code: def _get_batch_inputs_and_shardable_parameters(
      module: nn.Module,
      sharders: List[ModuleSharder[nn.Module]],
      batch_size: int,
      constraints: Optional[Dict[str, ParameterConstraints]] = None,
  ) -> Tuple[List[float], Set[nn.Module]]:
      sharder_map: Dict[str, ModuleSharder[nn.Module]] = {
          sharder_name(sharder.module_type): sharder
          for sharder in sharders
      }
      input_lengths: List[float] = []
      batch_sizes: List[int] = []
      shardable_modules: Set[nn.Module] = set()
  
      def populate_shardable_modules(
          module: nn.Module,
      ) -> None:
          sharder_key = sharder_name(type(module))
          sharder = sharder_map.get(sharder_key)
  
          if not sharder:
              for _child_name, child in module.named_children():
                  populate_shardable_modules(child)
          else:
              names = sharder.shardable_parameters(module).keys()
              shardable_modules.add(module)
  
              for name in names:
                  pooling_factors = (
                      constraints[name].pooling_factors
                      if constraints and constraints.get(name)
                      else [POOLING_FACTOR]
                  )
                  input_lengths.extend(pooling_factors)
                  batch_sizes.extend(
                      constraints[name].batch_sizes  # pyre-ignore[6]
                      if constraints
                      and constraints.get(name)
                      and constraints[name].batch_sizes
                      else [batch_size] * len(pooling_factors)
                  )
  
      populate_shardable_modules(module)
  
      batch_inputs: List[float] = [
          input_length * batch_size
          for input_length, batch_size in zip(
              input_lengths, batch_sizes
          )
      ]
  
      return batch_inputs, shardable_modules
  
imports: import copy
  import logging
  import math
  from typing import Dict, List, Optional, Set, Tuple
  from torch import nn
  from torchrec.distributed.planner.constants import BIGINT_DTYPE, POOLING_FACTOR
  from torchrec.distributed.planner.types import ParameterConstraints, PlannerError, PlannerErrorType, Storage, StorageReservation, Topology
  from torchrec.distributed.planner.utils import sharder_name, storage_repr_in_gb
  from torchrec.distributed.types import get_tensor_size_bytes, ModuleSharder
label_desc: Use image node_id 6 for calling a global function with example usage: _get_batch_inputs_and_shardable_parameters(module, sharders, batch_size, constraints) and returns: batch_inputs,  shardable_modules