code: def update_optim_dict(optim_dict, org_smile, cur_smile, imp, sim):
      if imp <= 0.0 or sim == 1.0:
          return optim_dict
  
      else:
          if org_smile not in optim_dict:
              optim_dict[org_smile] = [
                  ["", -100, -1],
                  ["", -100, -1],
                  ["", -100, -1],
                  ["", -100, -1],
              ]
          if sim >= 0.0:
              if imp > optim_dict[org_smile][0][1]:
                  optim_dict[org_smile][0][0] = cur_smile
                  optim_dict[org_smile][0][1] = imp
                  optim_dict[org_smile][0][2] = sim
  
          if sim >= 0.2:
              if imp > optim_dict[org_smile][1][1]:
                  optim_dict[org_smile][1][0] = cur_smile
                  optim_dict[org_smile][1][1] = imp
                  optim_dict[org_smile][1][2] = sim
  
          if sim >= 0.4:
              if imp > optim_dict[org_smile][2][1]:
                  optim_dict[org_smile][2][0] = cur_smile
                  optim_dict[org_smile][2][1] = imp
                  optim_dict[org_smile][2][2] = sim
  
          if sim >= 0.6:
              if imp > optim_dict[org_smile][3][1]:
                  optim_dict[org_smile][3][0] = cur_smile
                  optim_dict[org_smile][3][1] = imp
                  optim_dict[org_smile][3][2] = sim
          return optim_dict
  
imports: import sys
  import os
  import numpy
  import networkx
  import random
  from rdkit import Chem
  from rdkit.Chem import rdmolops
  from rdkit.Chem import rdMolDescriptors
  from rdkit import DataStructs
  import torch
  import torch.nn.functional
label_desc: Use image node_id 7 for calling a global function with example usage: update_optim_dict(optim_dict, org_smile, cur_smile, imp, sim) and returns: optim_dict, optim_dict