code: def calcuate_bboxes(im_shape, patch_size):
      """Calculate bound boxes based on image shape and size of the bounding box
      given by `patch_size`"""
      h, w = im_shape
      ph, pw = patch_size
  
      steps_h = chain(range(0, h - ph, ph), [h - ph])
      steps_w = chain(range(0, w - pw, pw), [w - pw])
  
      return product(steps_h, steps_w)
  
file_path: skorch/examples/nuclei_image_segmentation/dataset.py
imports: from itertools import zip_longest, product, chain
  import random
  import numpy
  import torch
  from torch.utils.data import Dataset
  from torchvision.transforms.functional import pad, to_tensor, normalize, hflip, vflip, crop
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: calcuate_bboxes(im_shape, patch_size) and returns: product