code: def check_average_pooling_global(self, name, by_type=False):
      dec = self.on_generate_function_by_name
      if by_type:
          dec = self.on_generate_function_by_type
  
      @dec(name)
      def on_avgpool_check(f):
          pool_shape = f.inputs[0].proto.shape.dim[2:]
          p = f.proto.average_pooling_param
          if (
              p.kernel.dim[:] != pool_shape
              or p.stride.dim[:] != pool_shape
          ):
              raise ValueError(
                  "Stride configuration of average pooling is not for global pooling."
                  " Given Image shape is {}, whereas pooling window size is {} and its stride is {}."
                  " Consider using force_global_pooling=True".format(
                      pool_shape, p.kernel.dim[:], p.stride.dim[:]
                  )
              )
          return f
  
imports: from __future__ import print_function
  import itertools
  from collections import OrderedDict
  import nnabla
  import numpy
label_desc: Use image node_id 15 for calling the NnpNetworkPass obj's underlying member method code with example usage: obj.check_average_pooling_global(name, by_type) and returns: f