text: import os
  import fnmatch
  
  def list_all_files(directory, extensions=None):
      for root, dirnames, filenames in os.walk(directory):
          for filename in filenames:
              base, ext = os.path.splitext(filename)
              joined = os.path.join(root, filename)
              if extensions is None or ext.lower() in extensions:
                  yield joined