code: def build_url(label: str, base: str, end: str) -> str:
      """Build a URL from the label, a base, and an end."""
      clean_label = re.sub(r"([ ]+_)|(_[ ]+)|([ ]+)", "_", label)
      return "{}{}{}".format(base, clean_label, end)
  
file_path: markdown/markdown/extensions/wikilinks.py
imports: from __future__ import annotations
  from .None import Extension
  from ..inlinepatterns import InlineProcessor
  import xml.etree.ElementTree
  import re
  from typing import Any
label_desc: Use image node_id 1 for calling a global function with example usage: build_url(label, base, end) and returns: str