code: def build_deepwalk_corpus_iter(
      G, num_paths, path_length, alpha=0, rand=random.Random(0)
  ):
      walks = []
  
      nodes = list(G.nodes())
  
      for cnt in range(num_paths):
          rand.shuffle(nodes)
          for node in nodes:
              yield G.random_walk(
                  path_length, rand=rand, alpha=alpha, start=node
              )
  
imports: import logging
  import sys
  from io import open
  from os import path
  from time import time
  from glob import glob
  from six.moves import range, zip, zip_longest
  from six import iterkeys
  from collections import defaultdict, Iterable
  import random
  from random import shuffle
  from itertools import product, permutations
  from scipy.io import loadmat
  from scipy.sparse import issparse
label_desc: Use image node_id 2 for calling a global function with example usage: build_deepwalk_corpus_iter(G, num_paths, path_length, alpha, rand) without return types