class_docstr: Implementation of Dataset class
  
  This is a simple implementation of loading and processing dataset for metapath2vec model.
  
  Args:
      config: dict, some configure parameters.
class_docstr_tok: ["Implementation","of","Dataset","class","This","is","a","simple","implementation","of","loading","and","processing","dataset","for","metapath2vec","model",".","Args",":","config",":","dict",",","some","configure","parameters","."]
docstr: Generate walks from files.
          
docstr_tok: ["Generate","walks","from","files","."]
code: def walk_from_files(self, walkpath_files):
      """Generate walks from files."""
      bucket = []
      for filename in walkpath_files:
          with open(filename) as reader:
              for line in reader:
                  words = line.strip().split()
                  words = [
                      w
                      for w in words
                      if int(w) < self.config["paper_start_index"]
                  ]
                  if len(words) > 1:
                      word_ids = [
                          self.word2id[w]
                          for w in words
                          if w in self.word2id
                      ]
                      bucket.append(word_ids)
                      if len(bucket) == self.config["batch_size"]:
                          yield bucket
                          bucket = []
      if len(bucket):
          yield bucket
  
file_path: PGL/legacy/examples/metapath2vec/Dataset.py
imports: import sys
  import os
  import glob
  import numpy
  import tqdm
  import time
  import logging
  import random
  from pgl import heter_graph
  import pickle
label_desc: Use image node_id 6 for calling the Dataset obj's underlying member method code with example usage: obj.walk_from_files(walkpath_files) without return types