code: def weight_matrix(file_path, sigma2=0.1, epsilon=0.5, scaling=True):
      """Load weight matrix function."""
      try:
          W = pd.read_csv(file_path, header=None).values
      except FileNotFoundError:
          print(f"ERROR: input file was not found in {file_path}.")
  
      # check whether W is a 0/1 matrix.
      if set(np.unique(W)) == {0, 1}:
          print(
              'The input graph is a 0/1 matrix; set "scaling" to False.'
          )
          scaling = False
  
      if scaling:
          n = W.shape[0]
          W = W / 10000.0
          W2, W_mask = W * W, np.ones([n, n]) - np.identity(n)
          # refer to Eq.10
          return (
              np.exp(-W2 / sigma2)
              * (np.exp(-W2 / sigma2) >= epsilon)
              * W_mask
          )
      else:
          return W
  
file_path: PGL/legacy/examples/stgcn/data_loader/graph.py
imports: import sys
  import os
  import numpy
  import pandas
  from pgl.graph import Graph
label_desc: Use image node_id 1 for calling a global function with example usage: weight_matrix(file_path, sigma2, epsilon, scaling) and returns: unknown, W