code: def build_edge_id(
      edge_path, num_nodes, startup_host, startup_port, num_bucket
  ):
      src, dst = load_data(edge_path)
      rs, nodemanager = get_redis(startup_host, startup_port)
      part_edge_dict = {}
      for i in tqdm.tqdm(range(len(src))):
          key = "e:%s" % i
          part = crc16_hash(key) % num_bucket
          if part not in part_edge_dict:
              part_edge_dict[part] = {}
          edge_dict = part_edge_dict[part]
          edge_dict["e:%s" % i] = int(src[i]) * num_nodes + int(dst[i])
          if len(edge_dict) > 10000:
              slot = nodemanager.keyslot("part-%s" % part)
              node = nodemanager.slots[slot][0]["name"]
              while True:
                  res = rs[node].hmset("part-%s" % part, edge_dict)
                  if res:
                      break
                  log.info("HMSET FAILED RETRY connected %s" % node)
                  time.sleep(1)
  
              part_edge_dict[part] = {}
  
      for part, edge_dict in part_edge_dict.items():
          if len(edge_dict) > 0:
              slot = nodemanager.keyslot("part-%s" % part)
              node = nodemanager.slots[slot][0]["name"]
              while True:
                  res = rs[node].hmset("part-%s" % part, edge_dict)
                  if res:
                      break
                  log.info("HMSET FAILED RETRY connected %s" % node)
                  time.sleep(1)
              part_edge_dict[part] = {}
  
imports: import sys
  import json
  import logging
  from collections import defaultdict
  import tqdm
  import redis
  from redis._compat import b, unicode, bytes, long, basestring
  from rediscluster.nodemanager import NodeManager
  from rediscluster.crc import crc16
  import argparse
  import time
  import pickle
  import numpy
  import scipy.sparse
label_desc: Use image node_id 6 for calling a global function with example usage: build_edge_id(edge_path, num_nodes, startup_host, startup_port, num_bucket) without return types