code: def extend_results(index, all_res, im_res):
      """Add results for an image to the set of all results at the specified
      index.
      """
      # Skip cls_idx 0 (__background__)
      for cls_idx in range(1, len(im_res)):
          all_res[cls_idx][index] = im_res[cls_idx]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from collections import defaultdict
  import cv2
  import datetime
  import logging
  import numpy
  import os
  import yaml
  from caffe2.python import workspace
  from detectron.core.config import cfg
  from detectron.core.config import get_output_dir
  from detectron.core.rpn_generator import generate_rpn_on_dataset
  from detectron.core.rpn_generator import generate_rpn_on_range
  from detectron.core.test import im_detect_all
  from detectron.datasets import task_evaluation
  from detectron.datasets.json_dataset import JsonDataset
  from detectron.modeling import model_builder
  from detectron.utils.io import save_object
  from detectron.utils.timer import Timer
  import detectron.utils.c2
  import detectron.utils.env
  import detectron.utils.net
  import detectron.utils.subprocess
  import detectron.utils.vis
label_desc: Use image node_id 10 for calling a global function with example usage: extend_results(index, all_res, im_res) without return types