code: def filelist(folderpath, ext=None):
      '''
      Returns a list of all the files contained in the folder specified by `folderpath`.
      To filter the files by extension simply add a list containing all the extension with `.` as the second argument.
      If `flat` is False, then the Path objects are returned.
      '''
      if not ext:
          ext = []
      if os.path.exists(folderpath) and os.path.isdir(folderpath):
          return [ os.path.join(folderpath, f) for f in os.listdir(folderpath) if os.path.isfile(os.path.join(folderpath, f)) and os.path.splitext(f)[1] in ext ]
      else:
          log.warn('"{}" does not exist or is not a directory'.format(folderpath)f filelist(folderpath, ext=None):
      '''
      Returns a list of all the files contained in the folder specified by `folderpath`.
      To filter the files by extension simply add a list containing all the extension with `.` as the second argument.
      If `flat` is False, then the Path objects are returned.
      '''
      if not ext:
          ext = []
      if os.path.exists(folderpath) and os.path.isdir(folderpath):
          return [ os.path.join(folderpath, f) for f in os.listdir(folderpath) if os.path.isfile(os.path.join(folderpath, f)) and os.path.splitext(f)[1] in ext ]
      else:
          log.warn('"{}" does not exist or is not a directory'.format(folderpath))
docs: Returns a list of all the files contained in the folder specified by `folderpath`.
      To filter the files by extension simply add a list containing all the extension with `.` as the second argument.
      If `flat` is False, then the Path objects are returned.