nodes: 0, module; 1, function_definition; 2, function_name:makeOfficialGlyphOrder; 3, parameters; 4, block; 5, identifier:font; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, for_statement; 13, expression_statement; 14, return_statement; 15, identifier:glyphOrder; 16, None; 17, comment:""" Make the final glyph order for 'font'.
  
      If glyphOrder is None, try getting the font.glyphOrder list.
      If not explicit glyphOrder is defined, sort glyphs alphabetically.
  
      If ".notdef" glyph is present in the font, force this to always be
      the first glyph (at index 0).
      """; 18, comparison_operator:glyphOrder is None; 19, block; 20, assignment; 21, assignment; 22, comparison_operator:".notdef" in names; 23, block; 24, identifier:name; 25, identifier:glyphOrder; 26, block; 27, call; 28, identifier:order; 29, identifier:glyphOrder; 30, None; 31, expression_statement; 32, identifier:names; 33, call; 34, identifier:order; 35, list; 36, string:".notdef"; 37, identifier:names; 38, expression_statement; 39, expression_statement; 40, if_statement; 41, expression_statement; 42, expression_statement; 43, attribute; 44, argument_list; 45, assignment; 46, identifier:set; 47, argument_list; 48, call; 49, call; 50, comparison_operator:name not in names; 51, block; 52, call; 53, call; 54, identifier:order; 55, identifier:extend; 56, call; 57, identifier:glyphOrder; 58, call; 59, call; 60, attribute; 61, argument_list; 62, attribute; 63, argument_list; 64, identifier:name; 65, identifier:names; 66, continue_statement; 67, attribute; 68, argument_list; 69, attribute; 70, argument_list; 71, identifier:sorted; 72, argument_list; 73, identifier:getattr; 74, argument_list; 75, attribute; 76, argument_list; 77, identifier:names; 78, identifier:remove; 79, string:".notdef"; 80, identifier:order; 81, identifier:append; 82, string:".notdef"; 83, identifier:names; 84, identifier:remove; 85, identifier:name; 86, identifier:order; 87, identifier:append; 88, identifier:name; 89, identifier:names; 90, identifier:font; 91, string:"glyphOrder"; 92, tuple; 93, identifier:font; 94, identifier:keys
code: def makeOfficialGlyphOrder(font, glyphOrder=None):
      """ Make the final glyph order for 'font'.
  
      If glyphOrder is None, try getting the font.glyphOrder list.
      If not explicit glyphOrder is defined, sort glyphs alphabetically.
  
      If ".notdef" glyph is present in the font, force this to always be
      the first glyph (at index 0).
      """
      if glyphOrder is None:
          glyphOrder = getattr(font, "glyphOrder", ())
      names = set(font.keys())
      order = []
      if ".notdef" in names:
          names.remove(".notdef")
          order.append(".notdef")
      for name in glyphOrder:
          if name not in names:
              continue
          names.remove(name)
          order.append(name)
      order.extend(sorted(names))
      return order