code: def _pooling(net, stride, operation, use_bounded_activation):
      """Parses operation and performs the correct pooling operation on net."""
      padding = "SAME"
      pooling_type, pooling_shape = _operation_to_pooling_info(
          operation
      )
      if use_bounded_activation:
          net = tf.nn.relu6(net)
      if pooling_type == "avg":
          net = slim.avg_pool2d(
              net, pooling_shape, stride=stride, padding=padding
          )
      elif pooling_type == "max":
          net = slim.max_pool2d(
              net, pooling_shape, stride=stride, padding=padding
          )
      else:
          raise NotImplementedError(
              "Unimplemented pooling type: ", pooling_type
          )
      return net
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
label_desc: Use image node_id 14 for calling a global function with example usage: _pooling(net, stride, operation, use_bounded_activation) and returns: net