code: def get_left_upper_corner(img, pos, size=PATCH_SIZE):
      """
      pos - [x, y]
      return the left upper corner of a patch centered(as centered as possible) at pos.
      """
      h, w, _ = img.shape
      lu_y = int(pos[1] - size // 2)
      lu_x = int(pos[0] - size // 2)
      if lu_y < 0:
          lu_y -= lu_y
      if lu_x < 0:
          lu_x -= lu_x
      if lu_y + size > h:
          lu_y -= (lu_y + size) - (h)
      if lu_x + size > w:
          lu_x -= (lu_x + size) - (w)
      return np.array([lu_x, lu_y])
  
file_path: ml-neuman/datasets/human_rays.py
imports: import os
  import random
  import numpy
  import torch
  from torch.utils import data
  from data_io import cache_helper
  from utils import ray_utils
  from utils.constant import PATCH_SIZE, PATCH_SIZE_SQUARED, NEAR_INDEX, FAR_INDEX, TRAIN_SET_LENGTH, VALIDATION_SET_LENGTH
  from data_io import neuman_helper
label_desc: Use image node_id 1 for calling a global function with example usage: get_left_upper_corner(img, pos, size) and returns: np