code: def conv_block(
      input, groups, filters, ksizes, strides=None, with_pool=True
  ):
      assert len(filters) == groups
      assert len(ksizes) == groups
      strides = [1] * groups if strides is None else strides
      w_attr = ParamAttr(learning_rate=1.0, initializer=Xavier())
      b_attr = ParamAttr(learning_rate=2.0, regularizer=L2Decay(0.0))
      conv = input
      for i in six.moves.xrange(groups):
          conv = fluid.layers.conv2d(
              input=conv,
              num_filters=filters[i],
              filter_size=ksizes[i],
              stride=strides[i],
              padding=(ksizes[i] - 1) // 2,
              param_attr=w_attr,
              bias_attr=b_attr,
              act="relu",
          )
      if with_pool:
          pool = fluid.layers.pool2d(
              input=conv,
              pool_size=2,
              pool_type="max",
              pool_stride=2,
              ceil_mode=True,
          )
          return conv, pool
      else:
          return conv
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import paddle.fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.initializer import Xavier
  from paddle.fluid.initializer import Constant
  from paddle.fluid.initializer import Bilinear
  from paddle.fluid.regularizer import L2Decay
label_desc: Use image node_id 2 for calling a global function with example usage: conv_block(input, groups, filters, ksizes, strides, with_pool) and returns: conv,  pool, conv