code: def encode_sku_fields(datapath, sku_encoder, sku_decoder):
      # sku_id,brand,shop_id,cate,market_time
      sku_info_encoder = {"brand": {}, "shop": {}, "cate": {}}
      sku_info_decoder = {"brand": [], "shop": [], "cate": []}
      sku_info = {}
      brand_id, shop_id, cate_id = -1, -1, -1
      with open(datapath, "r") as f:
          f.readline()
          for line in f:
              line = line.replace("\n", "")
              fields = line.split(",")
              sku_raw_id = fields[0]
  
              brand_raw_id = fields[1]
              shop_raw_id = fields[2]
              cate_raw_id = fields[3]
  
              if sku_raw_id in sku_encoder:
                  sku_id = sku_encoder[sku_raw_id]
  
                  brand_id = encode_id(
                      sku_info_encoder["brand"],
                      sku_info_decoder["brand"],
                      brand_raw_id,
                      brand_id,
                  )
  
                  shop_id = encode_id(
                      sku_info_encoder["shop"],
                      sku_info_decoder["shop"],
                      shop_raw_id,
                      shop_id,
                  )
  
                  cate_id = encode_id(
                      sku_info_encoder["cate"],
                      sku_info_decoder["cate"],
                      cate_raw_id,
                      cate_id,
                  )
  
                  sku_info[sku_id] = [
                      sku_id,
                      brand_id,
                      shop_id,
                      cate_id,
                  ]
  
      return sku_info_encoder, sku_info_decoder, sku_info
  
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 8 for calling a global function with example usage: encode_sku_fields(datapath, sku_encoder, sku_decoder) and returns: sku_info_encoder,  sku_info_decoder,  sku_info