class_docstr: The class wrapper the PGL graph, the class involve the funtions to implement struc2vec algorithm.
docstr: according to the BFS to get the degree of each layer
docstr_tok: ["according","to","the","BFS","to","get","the","degree","of","each","layer"]
code: def output_degree_with_depth(self, depth, opt1):
      """
      according to the BFS to get the degree of each layer
      """
      degree_dict = dict()
  
      for node in self.nodes:
          start_node = node
          cur_node = node
          cur_dep = 0
          flag_visit = set()
          while cur_node is not None and cur_dep < depth:
              if not isinstance(cur_node, list):
                  cur_node = [cur_node]
              filter_node = []
              for node in cur_node:
                  if node not in flag_visit:
                      flag_visit.add(node)
                      filter_node.append(node)
              cur_node = filter_node
              if len(cur_node) == 0:
                  break
              outdegree = self.graph.outdegree(cur_node)
              mask = outdegree != 0
              if np.any(mask):
                  outdegree = np.sort(outdegree[mask])
              else:
                  break
              # save the layer degree message to dict
              self.add_degree_todict(
                  start_node, outdegree[mask], cur_dep, opt1
              )
              succes = self.graph.successor(cur_node)
              cur_node = []
              for succ in succes:
                  if isinstance(succ, np.ndarray):
                      cur_node.extend(succ.flatten().tolist())
                  elif isinstance(succ, int):
                      cur_node.append(succ)
              cur_node = list(set(cur_node))
              cur_dep += 1
  
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 5 for calling the StrucVecGraph obj's underlying member method code with example usage: obj.output_degree_with_depth(depth, opt1) without return types