code: def ensure_within_bounds(box, size):
      box["xmin"] = np.minimum(
          np.maximum(box["xmin"], 0), size["width"] - 1
      )
      box["xmax"] = np.minimum(
          np.maximum(box["xmax"], 0), size["width"] - 1
      )
      box["ymin"] = np.minimum(
          np.maximum(box["ymin"], 0), size["height"] - 1
      )
      box["ymax"] = np.minimum(
          np.maximum(box["ymax"], 0), size["height"] - 1
      )
  
      return box
  
imports: import pickle
  import glob
  import os
  import json
  import spacenet_utils
  from PIL import Image, ImageDraw
  from collections import OrderedDict
  import ingest_utils
  import numpy
  from tqdm import tqdm
  import warnings
  from configargparse import ArgumentParser
  from neon.util.persist import get_data_cache_or_nothing
label_desc: Use image node_id 3 for calling a global function with example usage: ensure_within_bounds(box, size) and returns: box