code: def scandir(path, app=None):
      '''
      Config-aware scandir. Currently, only aware of ``exclude_fnc``.
  
      :param path: absolute path
      :type path: str
      :param app: flask application
      :type app: flask.Flask or None
      :returns: filtered scandir entries
      :rtype: iterator
      '''
      exclude = app and app.config.get('exclude_fnc')
      if exclude:
          return (
              item
              for item in compat.scandir(path)
              if not exclude(item.path)
              )
      return compat.scandir(pathf scandir(path, app=None):
      '''
      Config-aware scandir. Currently, only aware of ``exclude_fnc``.
  
      :param path: absolute path
      :type path: str
      :param app: flask application
      :type app: flask.Flask or None
      :returns: filtered scandir entries
      :rtype: iterator
      '''
      exclude = app and app.config.get('exclude_fnc')
      if exclude:
          return (
              item
              for item in compat.scandir(path)
              if not exclude(item.path)
              )
      return compat.scandir(path)
docs: Config-aware scandir. Currently, only aware of ``exclude_fnc``.
  
      :param path: absolute path
      :type path: str
      :param app: flask application
      :type app: flask.Flask or None
      :returns: filtered scandir entries
      :rtype: iterator