code: def path_filter(extensions, exclude_paths=None):
      
      exclude_paths = exclude_paths or []
  
      def the_filter(path):
          if not any(matches_extension(path, extension)
                     for extension in extensions):
              return False
          if exclude_paths:
              for excluded in exclude_paths:
                  if (path.startswith(excluded) or
                          path.startswith('./' + excluded) or
                          fnmatch.fnmatch(path, excluded)):
                      return False
          return True
      return the_filter
docs: Returns a function that returns True if a filepath is acceptable.
  
      @param extensions     An array of strings. Specifies what file
                            extensions should be accepted by the
                            filter. If None, we default to the Unix glob
                            `*` and match every file extension.
      @param exclude_paths  An array of strings which represents filepaths
                            that should never be accepted by the filter. Unix
                            shell-style wildcards are supported.
  
      @return function      A filter function that will only return True
                            when a filepath is acceptable under the above
                            conditions.
  
      >>> list(map(path_filter(extensions=['js', 'php']),
      ...     ['./profile.php', './q.jjs']))
      [True, False]
      >>> list(map(path_filter(extensions=['*'],
      ...                 exclude_paths=['html']),
      ...     ['./html/x.php', './lib/y.js']))
      [False, True]
      >>> list(map(path_filter(extensions=['js', 'BUILD']),
      ...     ['./a.js', './BUILD', './profile.php']))
      [True, True, False]
      >>> list(map(path_filter(extensions=['js'],
      ...     exclude_paths=['*/node_modules/*']),
      ...     ['./a.js', './tools/node_modules/dep.js']))
      [True, False]