def _PrintEnums(proto_printer, enum_types):
    """Print all enums to the given proto_printer."""
    enum_types = sorted(enum_types, key=operator.attrgetter('name'))
    for enum_type in enum_types:
        proto_printer.PrintEnum(enum_type)
Print all enums to the given proto_printer.