def has_tag(element, tag):
  """Detects whether an XML element has the given tag."""
  if element.tag != f"{XMLNS}{tag}":
    return False
  return True
Detects whether an XML element has the given tag.
language/fruit/wiki_utils.py