code: def pooling_type_to_str(pooling_type: PoolingType) -> str:
      if pooling_type.value == PoolingType.SUM.value:
          return "sum"
      elif pooling_type.value == PoolingType.MEAN.value:
          return "mean"
      else:
          raise ValueError(f"Unsupported pooling type {pooling_type}")
  
imports: from dataclasses import dataclass, field
  from enum import Enum, unique
  from functools import partial
  from math import sqrt
  from typing import Callable, Dict, List, NamedTuple, Optional
  import torch
  from fbgemm_gpu.split_embedding_configs import SparseType
  from fbgemm_gpu.split_table_batched_embeddings_ops_training import PoolingMode
  from torchrec.types import DataType
label_desc: Use image node_id 3 for calling a global function with example usage: pooling_type_to_str(pooling_type) and returns: str, str