code: def shrink_bbox_space(hist_tasks, curr_task):
      """Shrink search space with bounding box representation according to the historical knowledge"""
      hist_bound = np.zeros((2, len(curr_task["space"])))
      adj_bound = np.zeros((2, len(curr_task["space"])))
  
      hist_opt, curr_bound = rep_task(hist_tasks, curr_task)
  
      hist_bound[0, :] = np.min(hist_opt, axis=0)
      hist_bound[1, :] = np.max(hist_opt, axis=0)
  
      adj_bound[0, :] = np.max(
          np.stack((hist_bound[0], curr_bound[0])), axis=0
      )
      adj_bound[1, :] = np.min(
          np.stack((hist_bound[1], curr_bound[1])), axis=0
      )
  
      if np.any(adj_bound[0] > adj_bound[1]):
          return  # if no intersection, return curr setting space
      for i in range(len(curr_task["space"])):
          key_item = next(iter(curr_task["space"][i].keys()))
          curr_task["space"][i][key_item][0] = adj_bound[0, i]
          curr_task["space"][i][key_item][1] = adj_bound[1, i]
      return
  
imports: import logging
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: shrink_bbox_space(hist_tasks, curr_task) without return types