code: def encode_id(encoder, decoder, raw_id, encoded_id):
      if raw_id in encoder:
          return encoded_id
      else:
          encoded_id += 1
          encoder[raw_id] = encoded_id
          decoder.append(raw_id)
  
      return encoded_id
  
file_path: dgl/examples/pytorch/eges/utils.py
imports: import argparse
  import random
  from datetime import datetime
  import dgl
  import networkx
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: encode_id(encoder, decoder, raw_id, encoded_id) and returns: encoded_id, encoded_id