code: def find_empty_alt(content, path):
      """Find images with empty alt
  
      Create warnings for all images with empty alt (up to a certain number),
      as they are really likely to be accessibility flaws.
  
      """
      imgs = re.compile(
          r"""
          (?:
              # src before alt
              <img
              [^\>]*
              src=(['"])(.*?)\1
              [^\>]*
              alt=(['"])\3
          )|(?:
              # alt before src
              <img
              [^\>]*
              alt=(['"])\4
              [^\>]*
              src=(['"])(.*?)\5
          )
          """,
          re.X,
      )
      for match in re.findall(imgs, content):
          logger.warning(
              "Empty alt attribute for image %s in %s",
              os.path.basename(match[1] + match[5]),
              path,
              extra={
                  "limit_msg": "Other images have empty alt attributes"
              },
          )
  
imports: import datetime
  import logging
  import os
  import re
  from collections import OrderedDict
  from html import escape
  from html.parser import HTMLParser
  from io import StringIO
  import docutils
  import docutils.core
  import docutils.io
  from docutils.parsers.rst.languages import get_language
  from docutils.writers.html4css1 import HTMLTranslator, Writer
  from pelican import rstdirectives
  from pelican.cache import FileStampDataCacher
  from pelican.contents import Author, Category, Page, Tag
  from pelican.plugins import signals
  from pelican.utils import get_date, pelican_open, posixize_path
label_desc: Use image node_id 5 for calling a global function with example usage: find_empty_alt(content, path) without return types