code: def extract_filenames(corpus_path, follow_links=False):
      if os.listdir(corpus_path) == []:
          raise ValueError("%s: path is empty" % corpus_path)
      for root, _, fnames in os.walk(
          corpus_path, followlinks=follow_links
      ):
          for filename in fnames:
              try:
                  yield os.path.join(root, filename)
              except Exception:
                  continue
  
file_path: ktrain/ktrain/text/shallownlp/utils.py
imports: from .imports import *
label_desc: Use image node_id 1 for calling a global function with example usage: extract_filenames(corpus_path, follow_links) without return types