class_docstr: The class wrapper the PGL graph, the class involve the funtions to implement struc2vec algorithm.
docstr: Use the dtw algorithm to calculate the distance between nodes. 
docstr_tok: ["Use","the","dtw","algorithm","to","calculate","the","distance","between","nodes","."]
code: def calc_distances_between_nodes(self):
      """
      Use the dtw algorithm to calculate the distance between nodes.
      """
      from fastdtw import fastdtw
      from pathos.multiprocessing import Pool
  
      # decide use which algo to use
      if self.opt1 == True:
          self.distance_calc_func = self.distance_opt1_func
      else:
          self.distance_calc_func = self.distance_func
  
      dtws = []
      if self.opt2:
          depth = 0
          for node in self.nodes:
              if node in self.degree_list:
                  if depth in self.degree_list[node]:
                      degree = self.degree_list[node][depth]
                      if args.opt1:
                          degree = degree[0][0]
                      else:
                          degree = degree[0]
                  if degree not in self.degree2nodes:
                      self.degree2nodes[degree] = []
                  if node not in self.node2degree:
                      self.node2degree[node] = degree
                  self.degree2nodes[degree].append(node)
          # select the log(n) node to select data
          degree_keys = self.degree2nodes.keys()
          degree_keys = np.array(list(degree_keys), dtype="int")
          self.degrees_sorted = list(np.sort(degree_keys))
          selected_nbh_nums = 2 * math.log(self.graph.num_nodes - 1, 2)
          self.selected_nbh_nums = selected_nbh_nums
  
          pool = Pool(10)
          dtws = pool.map(
              self.calc_node_with_neighbor_dtw_opt2, self.nodes
          )
          pool.close()
          pool.join()
      else:
          src_indices = range(0, self.graph.num_nodes - 2)
  
          pool = Pool(10)
          dtws = pool.map(self.calc_node_with_neighbor_dtw, src_indices)
          pool.close()
          pool.join()
      print("calc the dtw done.")
      for dtw in dtws:
          self.distance.update(dtw)
  
imports: import argparse
  import math
  import random
  import numpy
  import pgl
  from pgl import graph
  from pgl.graph_kernel import alias_sample_build_table
  from pgl.sample import alias_sample
  from data_loader import EdgeDataset
  from classify import train_lr_model
  from sklearn_classify import train_lr_l2_model
label_desc: Use image node_id 9 for calling the StrucVecGraph obj's underlying member method code with example usage: obj.calc_distances_between_nodes() without return types