code: def block_view(A, block=(3, 3)):
      from numpy.lib.stride_tricks import as_strided as ast
      
      # simple shape and strides computations may seem at first strange
      # unless one is able to recognize the 'tuple additions' involved ;-)
      shape= (A.shape[0]/ block[0], A.shape[1]/ block[1])+ block
      strides= (block[0]* A.strides[0], block[1]* A.strides[1])+ A.strides
      return ast(A, shape= shape, strides= strides)
docs: Provide a 2D block view to 2D array. No error checking made.
      Therefore meaningful (as implemented) only for blocks strictly
      compatible with the shape of A.