code: def _is_blacklisted_filename(filepath):
      
  
      if not cfg.CONF.filename_blacklist:
          return False
  
      filename = os.path.basename(filepath)
      fname = os.path.splitext(filename)[0]
  
      blacklisted = False
      for fblacklist in cfg.CONF.filename_blacklist:
  
          if isinstance(fblacklist, dict):
              to_check = filename
              if fblacklist.get('exclude_extension', False):
                  to_check = fname
              if fblacklist.get('full_path', False):
                  to_check = filepath
  
              if fblacklist.get('is_regex', False):
                  blacklisted = re.match(fblacklist['match'],
                                         to_check) is not None
              else:
                  blacklisted = (fblacklist['match'] in to_check)
          else:
              blacklisted = (filename == fblacklist)
  
          if blacklisted:
              break
  
      return blacklisted
docs: Checks if the filename matches filename_blacklist
  
      blacklist is a list of filenames(str) and/or file patterns(dict)
  
      string, specifying an exact filename to ignore
      [".DS_Store", "Thumbs.db"]
  
      mapping(dict), where each dict contains:
          'match' - (if the filename matches the pattern, the filename
          is blacklisted)
  
          'is_regex' - if True, the pattern is treated as a
          regex. If False, simple substring check is used (if
          'match' in filename). Default is False
  
          'full_path' - if True, full path is checked. If False, only
          filename is checked. Default is False.
  
          'exclude_extension' - if True, the extension is removed
          from the file before checking. Default is False.
  
      :param str filepath: an absolute path and filename to check against
                           the blacklist
      :returns: flag indicating if the file was matched in the blacklist
      :rtype: bool