code: def basic_blocks(
      dim,
      index,
      layers,
      pool_size=3,
      mlp_ratio=4.0,
      act_layer=nn.GELU,
      norm_layer=GroupNorm,
      drop_rate=0.0,
      drop_path_rate=0.0,
      use_layer_scale=True,
      layer_scale_init_value=1e-5,
  ):
      """
      generate PoolFormer blocks for a stage
      return: PoolFormer blocks
      """
      blocks = []
      for block_idx in range(layers[index]):
          block_dpr = (
              drop_path_rate
              * (block_idx + sum(layers[:index]))
              / (sum(layers) - 1)
          )
          blocks.append(
              PoolFormerBlock(
                  dim,
                  pool_size=pool_size,
                  mlp_ratio=mlp_ratio,
                  act_layer=act_layer,
                  norm_layer=norm_layer,
                  drop=drop_rate,
                  drop_path=block_dpr,
                  use_layer_scale=use_layer_scale,
                  layer_scale_init_value=layer_scale_init_value,
              )
          )
      blocks = nn.Sequential(*blocks)
  
      return blocks
  
imports: from torch import nn
  from towhee.models.poolformer.groupnorm import GroupNorm
  from towhee.models.poolformer.poolformerblock import PoolFormerBlock
label_desc: Use image node_id 1 for calling a global function with example usage: basic_blocks(dim, index, layers, pool_size, mlp_ratio, act_layer, norm_layer, drop_rate, drop_path_rate, use_layer_scale, layer_scale_init_value) and returns: blocks