code: def clusters2labels(clusters, num_nodes):
      assert isinstance(clusters, list)
      assert all([isinstance(cluster, list) for cluster in clusters])
      assert all(
          [
              isinstance(node, Node)
              for cluster in clusters
              for node in cluster
          ]
      )
      assert isinstance(num_nodes, int)
  
      node_labels = np.zeros(num_nodes)
      for cluster_ind, cluster in enumerate(clusters):
          for node in cluster:
              node_labels[node.ind] = cluster_ind
      return node_labels
  
imports: import functools
  import operator
  import numpy
  import paddle
  from numpy.linalg import norm
  import cv2
label_desc: Use image node_id 3 for calling a global function with example usage: clusters2labels(clusters, num_nodes) and returns: node_labels