code: def propose_random_square_crop(mask, min_overlap=0.5):
      height, width = mask.shape
      mask_ys, mask_xs = np.where(
          mask > 0.5
      )  # mask==0 is known fragment and mask==1 is missing
  
      if height < width:
          crop_size = height
          obj_left, obj_right = mask_xs.min(), mask_xs.max()
          obj_width = obj_right - obj_left
          left_border = max(
              0,
              min(
                  width - crop_size - 1,
                  obj_left + obj_width * min_overlap - crop_size,
              ),
          )
          right_border = max(
              left_border + 1,
              min(
                  width - crop_size, obj_left + obj_width * min_overlap
              ),
          )
          start_x = np.random.randint(left_border, right_border)
          return start_x, 0, start_x + crop_size, height
      else:
          crop_size = width
          obj_top, obj_bottom = mask_ys.min(), mask_ys.max()
          obj_height = obj_bottom - obj_top
          top_border = max(
              0,
              min(
                  height - crop_size - 1,
                  obj_top + obj_height * min_overlap - crop_size,
              ),
          )
          bottom_border = max(
              top_border + 1,
              min(
                  height - crop_size, obj_top + obj_height * min_overlap
              ),
          )
          start_y = np.random.randint(top_border, bottom_border)
          return 0, start_y, width, start_y + crop_size
  
imports: import enum
  from copy import deepcopy
  import numpy
  from skimage import img_as_ubyte
  from skimage.transform import rescale, resize
  from .countless2d import zero_corrected_countless
label_desc: Use image node_id 1 for calling a global function with example usage: propose_random_square_crop(mask, min_overlap) and returns: start_x,  int,  unknown,  height, int,  start_y,  width,  unknown