code: def _extract_constraints_for_param(
      constraints: Optional[Dict[str, ParameterConstraints]], name: str
  ) -> Tuple[
      List[float],
      Optional[int],
      Optional[CacheParams],
      Optional[bool],
      Optional[bool],
      Optional[BoundsCheckMode],
  ]:
      input_lengths = [POOLING_FACTOR]
      col_wise_shard_dim = None
      cache_params = None
      enforce_hbm = None
      stochastic_rounding = None
      bounds_check_mode = None
  
      if constraints and constraints.get(name):
          input_lengths = constraints[name].pooling_factors
          col_wise_shard_dim = constraints[name].min_partition
          cache_params = constraints[name].cache_params
          enforce_hbm = constraints[name].enforce_hbm
          stochastic_rounding = constraints[name].stochastic_rounding
          bounds_check_mode = constraints[name].bounds_check_mode
  
      return (
          input_lengths,
          col_wise_shard_dim,
          cache_params,
          enforce_hbm,
          stochastic_rounding,
          bounds_check_mode,
      )
  
imports: import logging
  from typing import Dict, List, Optional, Tuple, Union
  from torch import nn
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.planner.constants import POOLING_FACTOR
  from torchrec.distributed.planner.shard_estimators import EmbeddingPerfEstimator, EmbeddingStorageEstimator
  from torchrec.distributed.planner.types import Enumerator, ParameterConstraints, PartitionByType, Shard, ShardEstimator, ShardingOption, Topology
  from torchrec.distributed.planner.utils import sharder_name
  from torchrec.distributed.sharding_plan import calculate_shard_sizes_and_offsets
  from torchrec.distributed.types import BoundsCheckMode, CacheParams, ModuleSharder, ShardingType
  from torchrec.modules.embedding_tower import EmbeddingTower, EmbeddingTowerCollection
label_desc: Use image node_id 1 for calling a global function with example usage: _extract_constraints_for_param(constraints, name) and returns: input_lengths,  col_wise_shard_dim,  cache_params,  enforce_hbm,  stochastic_rounding,  bounds_check_mode