code: def _compute_structural_distance(
      self,
      max_num_layers,
      workers=1,
      verbose=0,
  ):
      if os.path.exists(self.temp_path + "structural_dist.pkl"):
          structural_dist = pd.read_pickle(
              self.temp_path + "structural_dist.pkl"
          )
      else:
          if self.opt1_reduce_len:
              dist_func = cost_max
          else:
              dist_func = cost
  
          if os.path.exists(self.temp_path + "degreelist.pkl"):
              degreeList = pd.read_pickle(
                  self.temp_path + "degreelist.pkl"
              )
          else:
              degreeList = self._compute_ordered_degreelist(
                  max_num_layers
              )
              pd.to_pickle(
                  degreeList, self.temp_path + "degreelist.pkl"
              )
  
          if self.opt2_reduce_sim_calc:
              degrees = self._create_vectors()
              degreeListsSelected = {}
              vertices = {}
              n_nodes = len(self.idx)
              for v in self.idx:  # c:list of vertex
                  nbs = get_vertices(
                      v,
                      len(self.graph[self.idx2node[v]]),
                      degrees,
                      n_nodes,
                  )
                  vertices[v] = nbs  # store nbs
                  degreeListsSelected[v] = degreeList[v]  # store dist
                  for n in nbs:
                      # store dist of nbs
                      degreeListsSelected[n] = degreeList[n]
          else:
              vertices = {}
              for v in degreeList:
                  vertices[v] = [
                      vd for vd in degreeList.keys() if vd > v
                  ]
  
          results = Parallel(
              n_jobs=workers,
              verbose=verbose,
          )(
              delayed(compute_dtw_dist)(
                  part_list, degreeList, dist_func
              )
              for part_list in partition_dict(vertices, workers)
          )
          dtw_dist = dict(ChainMap(*results))
  
          structural_dist = convert_dtw_struc_dist(dtw_dist)
          pd.to_pickle(
              structural_dist, self.temp_path + "structural_dist.pkl"
          )
  
      return structural_dist
  
imports: import math
  import os
  import shutil
  from collections import ChainMap, deque
  import numpy
  import pandas
  from fastdtw import fastdtw
  from gensim.models import Word2Vec
  from joblib import Parallel, delayed
  from ..alias import create_alias_table
  from ..utils import partition_dict, preprocess_nxgraph
  from ..walker import BiasedWalker
label_desc: Use image node_id 8 for calling the Struc2Vec obj's underlying member method code with example usage: obj._compute_structural_distance(max_num_layers, workers, verbose) and returns: structural_dist