code: def get_partition_by_type(sharding_type: str) -> str:
      """
      Gets corresponding partition by type for provided sharding type.
  
      Args:
          sharding_type (str): sharding type string.
  
      Returns:
          str: the corresponding `PartitionByType` value.
      """
  
      device_sharding_types = {
          ShardingType.TABLE_WISE.value,
          ShardingType.COLUMN_WISE.value,
      }
      host_sharding_types = {
          ShardingType.TABLE_ROW_WISE.value,
          ShardingType.TABLE_COLUMN_WISE.value,
      }
      uniform_sharding_types = {
          ShardingType.ROW_WISE.value,
          ShardingType.DATA_PARALLEL.value,
      }
  
      if sharding_type in device_sharding_types:
          return PartitionByType.DEVICE.value
      elif sharding_type in host_sharding_types:
          return PartitionByType.HOST.value
      elif sharding_type in uniform_sharding_types:
          return PartitionByType.UNIFORM.value
  
      raise ValueError(
          f"Unrecognized or unsupported sharding type provided: {sharding_type}"
      )
  
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 2 for calling a global function with example usage: get_partition_by_type(sharding_type) and returns: PartitionByType, PartitionByType, PartitionByType