code: def tensor_clustering_coefficient(edge_index, num_nodes):
      coefficients = {}
      edge_list = {}
      for i in range(edge_index.shape[1]):
          if edge_index[0][i].item() in edge_list:
              edge_list[edge_index[0][i].item()].add(
                  edge_index[1][i].item()
              )
          else:
              edge_list[edge_index[0][i].item()] = set(
                  [edge_index[1][i].item()]
              )
      for node in range(num_nodes):
          neighbors = None
          if node in edge_list:
              neighbors = edge_list[node]
          else:
              coefficients[node] = 0
              continue
          if len(neighbors) < 2:
              coefficients[node] = 0
              continue
          count = 0
          for neighbor in neighbors:
              neighbor_neighbors = None
              if neighbor in edge_list:
                  neighbor_neighbors = edge_list[neighbor]
              else:
                  continue
              for neighbor_neighbor in neighbor_neighbors:
                  if neighbor_neighbor in neighbors:
                      if (
                          neighbor_neighbor != node
                          and neighbor_neighbor != neighbor
                      ):
                          count += 1
          coefficients[node] = (
              count / len(neighbors) / (len(neighbors) - 1)
          )
      feature = torch.tensor(
          [coefficients[node] for node in range(num_nodes)],
          dtype=torch.float32,
      ).view(num_nodes, 1)
      return feature
  
file_path: deepsnap/benchmark/transform/pagerank_clustering.py
imports: import time
  import torch
  import argparse
  import deepsnap
  import numpy
  from deepsnap.dataset import GraphDataset
  from torch_geometric.datasets import TUDataset
label_desc: Use image node_id 5 for calling a global function with example usage: tensor_clustering_coefficient(edge_index, num_nodes) and returns: feature