code: def add2dict(value, d):
      if value not in d:
          d[value] = len(d)
      return d[value]
  
file_path: recommenders/examples/07_tutorials/KDD2020-tutorial/utils/general.py
imports: import os
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: add2dict(value, d) and returns: d