original_docstring:  get patch of size bsize x bsize with most masks 
docstring: get patch of size bsize x bsize with most masks
docstring_tokens: get patch of size bsize x bsize with most masks
code: def interesting_patch(mask, bsize=130):
      """ get patch of size bsize x bsize with most masks """
      Ly,Lx = mask.shape
      m = np.float32(mask>0)
      m = gaussian_filter(m, bsize/2)
      y,x = np.unravel_index(np.argmax(m), m.shape)
      ycent = max(bsize//2, min(y, Ly-bsize//2))
      xcent = max(bsize//2, min(x, Lx-bsize//2))
      patch = [np.arange(ycent-bsize//2, ycent+bsize//2, 1, int),
               np.arange(xcent-bsize//2, xcent+bsize//2, 1, int)]
      return patch
code_tokens: def interesting_patch ( mask , bsize = 130 ) : Ly , Lx = mask . shape m = np . float32 ( mask > 0 ) m = gaussian_filter ( m , bsize / 2 ) y , x = np . unravel_index ( np . argmax ( m ) , m . shape ) ycent = max ( bsize // 2 , min ( y , Ly - bsize // 2 ) ) xcent = max ( bsize // 2 , min ( x , Lx - bsize // 2 ) ) patch = [ np . arange ( ycent - bsize // 2 , ycent + bsize // 2 , 1 , int ) , np . arange ( xcent - bsize // 2 , xcent + bsize // 2 , 1 , int ) ] return patch
short_docstring: get patch of size bsize x bsize with most masks
short_docstring_tokens: get patch of size bsize x bsize with most masks
comment: """ get patch of size bsize x bsize with most masks """