code: def get_label_attributes(train_mask_zs, nodeids, labellist, features):
      """Get the class-center (semanic knowledge) of each seen class.
      Suppose a node i is labeled as c, then attribute[c] += node_i_attribute, finally mean(attribute[c])
      Input: train_mask_zs, nodeids, labellist, features
      Output: label_attribute{}: label -> average_labeled_node_features (class centers)
      """
      _, feat_num = features.shape
      labels = get_class_set(labellist)
      label_attribute_nodes = defaultdict(list)
      for nodeid, labels in zip(nodeids, labellist):
          for label in labels:
              label_attribute_nodes[int(label)].append(int(nodeid))
      label_attribute = {}
      for label in label_attribute_nodes.keys():
          nodes = label_attribute_nodes[int(label)]
          selected_features = features[nodes, :]
          label_attribute[int(label)] = np.mean(
              selected_features, axis=0
          )
      return label_attribute
  
imports: from collections import defaultdict
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: get_label_attributes(train_mask_zs, nodeids, labellist, features) and returns: label_attribute