code: def _file_filter(cls, filename, include_patterns, exclude_patterns):
      
      logger.debug('filename: {}'.format(filename))
      for exclude_pattern in exclude_patterns:
        if exclude_pattern.match(filename):
          return False
      if include_patterns:
        found = False
        for include_pattern in include_patterns:
          if include_pattern.match(filename):
            found = True
            break
        if not found:
          return False
      return True
docs: :returns: `True` if the file should be allowed through the filter.