code: def normalizeGlyphFormatVersion(value):
      
      if not isinstance(value, (int, float)):
          raise TypeError("Glyph Format Version must be an "
                          ":ref:`type-int-float`, not %s."
                          % type(value).__name__)
      value = int(value)
      if value not in (1, 2):
          raise ValueError("Glyph Format Version must be either 1 or 2, not %s."
                           % value)
      return value
docs: Normalizes glyph format version for saving to XML string.
  
      * **value** must be a :ref:`type-int-float` of either 1 or 2.
      * Returned value will be an int.