code: def pool(pooling_type, words):
      # input dims: bsz * seq_len * num_filters
      if pooling_type == PoolingType.MEAN:
          return words.mean(dim=1)
      elif pooling_type == PoolingType.MAX:
          return words.max(dim=1)[0]
      elif pooling_type == PoolingType.NONE:
          return words
      else:
          return NotImplementedError
  
imports: import math
  import torch
  import torch.nn
  from pytext.config.module_config import Activation, CNNParams, PoolingType
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.optimizer import get_activation
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 1 for calling a global function with example usage: pool(pooling_type, words) and returns: words, words, words, NotImplementedError