def _enum_generator(descriptor):
    'Helper to create protobuf enums'
    vals = descriptor.enum_type.values_by_number.keys()
    return gen.IterValueGenerator(descriptor.name, vals)
Helper to create protobuf enums