code: def get_pooling_layer_hparams(hparams):
      """Creates pooling layer hparams `dict` usable for :func:`get_layer`.
  
      If the :attr:`hparams` sets `'pool_size'` to `None`, the layer will be
      changed to the respective reduce-pooling layer. For example,
      :class:`tf.layers.MaxPooling1D <layers/MaxPooling1D>` is replaced with
      :class:`~texar.tf.core.MaxReducePooling1D`.
      """
      if isinstance(hparams, HParams):
          hparams = hparams.todict()
  
      new_hparams = copy.copy(hparams)
      kwargs = new_hparams.get("kwargs", None)
  
      if kwargs and kwargs.get("pool_size", None) is None:
          pool_type = hparams["type"]
          new_hparams["type"] = _POOLING_TO_REDUCE.get(
              pool_type, pool_type
          )
          kwargs.pop("pool_size", None)
          kwargs.pop("strides", None)
          kwargs.pop("padding", None)
  
      return new_hparams
  
imports: import copy
  import tensorflow
  import tensorflow.contrib.rnn
  from texar.tf.hyperparams import HParams
  from texar.tf.utils import utils
  from texar.tf.utils.dtypes import is_str
  from texar.tf.utils.variables import add_variable
  from texar.tf.utils.mode import is_train_mode, switch_dropout
label_desc: Use image node_id 11 for calling a global function with example usage: get_pooling_layer_hparams(hparams) and returns: new_hparams