code: def build_node_feat(
      node_feat_path, num_nodes, startup_host, startup_port, num_bucket
  ):
      assert node_feat_path != "", "node_feat_path empty!"
      feat_dict = np.load(node_feat_path)
      for k in feat_dict.keys():
          feat = feat_dict[k]
          assert feat.shape[0] == num_nodes, "num_nodes invalid"
  
      rs, nodemanager = get_redis(startup_host, startup_port)
      part_feat_dict = {}
      for k in feat_dict.keys():
          feat = feat_dict[k]
          for i in tqdm.tqdm(range(num_nodes)):
              key = "nf:%s:%i" % (k, i)
              value = feat[i].tobytes()
              part = crc16_hash(key) % num_bucket
              if part not in part_feat_dict:
                  part_feat_dict[part] = {}
              part_feat = part_feat_dict[part]
              part_feat[key] = value
              if len(part_feat) > 100:
                  slot = nodemanager.keyslot("part-%s" % part)
                  node = nodemanager.slots[slot][0]["name"]
                  while True:
                      res = rs[node].hmset("part-%s" % part, part_feat)
                      if res:
                          break
                      log.info("HMSET FAILED RETRY connected %s" % node)
                      time.sleep(1)
  
                  part_feat_dict[part] = {}
  
      for part, part_feat in part_feat_dict.items():
          if len(part_feat) > 0:
              slot = nodemanager.keyslot("part-%s" % part)
              node = nodemanager.slots[slot][0]["name"]
              while True:
                  res = rs[node].hmset("part-%s" % part, part_feat)
                  if res:
                      break
                  log.info("HMSET FAILED RETRY connected %s" % node)
                  time.sleep(1)
              part_feat_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 8 for calling a global function with example usage: build_node_feat(node_feat_path, num_nodes, startup_host, startup_port, num_bucket) without return types