code: def get_patchid_from_coord(self, x, y):
      x = x // (self.pw + self.border)
      y = y // (self.pw + self.border)
      idx = y * self.nr_col + x
      return idx
  
file_path: tensorpack/tensorpack/utils/viz.py
imports: import numpy
  import os
  import sys
  from ..utils.develop import create_dummy_func
  from .argtools import shape2d
  from .fs import mkdir_p
label_desc: Use image node_id 3 for calling the Canvas obj's underlying member method code with example usage: obj.get_patchid_from_coord(x, y) and returns: idx