code: def clip_xyxy_to_image(x1, y1, x2, y2, height, width):
      """Clip coordinates to an image with the given height and width."""
      x1 = np.minimum(width - 1.0, np.maximum(0.0, x1))
      y1 = np.minimum(height - 1.0, np.maximum(0.0, y1))
      x2 = np.minimum(width - 1.0, np.maximum(0.0, x2))
      y2 = np.minimum(height - 1.0, np.maximum(0.0, y2))
      return x1, y1, x2, y2
  
file_path: vissl/vissl/data/datasets/coco.py
imports: import json
  import logging
  import os
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.utils.io import makedir, save_file
label_desc: Use image node_id 2 for calling a global function with example usage: clip_xyxy_to_image(x1, y1, x2, y2, height, width) and returns: x1,  y1,  x2,  y2