code: def insert_in_dic(dic, path, key, val):
      """
      This function inserts a particluar key-value pair in a dictionray
      after following a particular path.
      """
      temp = dic[path[0]]
      for idx in range(1, len(path)):
          if "listidx_" in path[idx]:
              temp = temp[int(path[idx].replace("listidx_", ""))]
          else:
              temp = temp[path[idx]]
      temp[key] = val
      # moving key-value pair to the start.
      temp.move_to_end(key, last=False)
  
file_path: mlpack/src/mlpack/bindings/python/mlpack/preprocess_json_params.py
imports: import numpy
  import json
  import pprint
  from copy import deepcopy
  from collections import OrderedDict
label_desc: Use image node_id 7 for calling a global function with example usage: insert_in_dic(dic, path, key, val) without return types