code: def _to_float(x):
      # Some AFM files use "," instead of "." as decimal separator -- this
      # shouldn't be ambiguous (unless someone is wicked enough to use "," as
      # thousands separator...).
      if isinstance(x, bytes):
          # Encoding doesn't really matter -- if we have codepoints >127 the call
          # to float() will error anyways.
          x = x.decode("latin-1")
      return float(x.replace(",", "."))
  
imports: from collections import namedtuple
  import logging
  import re
  from ._mathtext_data import uni2type1
label_desc: Use image node_id 2 for calling a global function with example usage: _to_float(x) and returns: float