code: def existence_check(text, list, err, msg, ignore_case=True,
                      str=False, max_errors=float("inf"), offset=0,
                      require_padding=True, dotall=False,
                      excluded_topics=None, join=False):
      
      flags = 0
  
      msg = " ".join(msg.split())
  
      if ignore_case:
          flags = flags | re.IGNORECASE
  
      if str:
          flags = flags | re.UNICODE
  
      if dotall:
          flags = flags | re.DOTALL
  
      if require_padding:
          regex = u"(?:^|\W){}[\W$]"
      else:
          regex = u"{}"
  
      errors = []
  
      # If the topic of the text is in the excluded list, return immediately.
      if excluded_topics:
          tps = topics(text)
          if any([t in excluded_topics for t in tps]):
              return errors
  
      rx = "|".join(regex.format(w) for w in list)
      for m in re.finditer(rx, text, flags=flags):
          txt = m.group(0).strip()
          errors.append((
              m.start() + 1 + offset,
              m.end() + offset,
              err,
              msg.format(txt),
              None))
  
      errors = truncate_to_max(errors, max_errors)
  
      return errors
docs: Build a checker that blacklists certain words.