code: def update_glyph_href_links(
      svg: etree.Element, id_map: Dict[str, str]
  ) -> None:
      # update all xlink:href="#glyph..." attributes to point to the new glyph ids
      for el in xpath(".//svg:*[starts-with(@xlink:href, '#glyph')]")(
          svg
      ):
          old_id = href_local_target(el)
          assert old_id is not None
          if old_id in id_map:
              new_id = id_map[old_id]
              el.attrib[XLINK_HREF] = f"#{new_id}"
  
file_path: catboost/contrib/python/fonttools/fontTools/subset/svg.py
imports: from __future__ import annotations
  import re
  from functools import lru_cache
  from itertools import chain, count
  from typing import Dict, Iterable, Iterator, List, Optional, Set, Tuple
  from fontTools import ttLib
  from fontTools.subset.util import _add_method
  from fontTools.ttLib.tables.S_V_G_ import SVGDocument
label_desc: Use image node_id 9 for calling a global function with example usage: update_glyph_href_links(svg, id_map) without return types