Convert a protobuf descriptor to a protofuzz generator for same type

def descriptor_to_generator(cls_descriptor, cls, limit=0):
    'Convert a protobuf descriptor to a protofuzz generator for same type'

    generators = []
    for descriptor in cls_descriptor.fields_by_name.values():
        generator = _prototype_to_generator(descriptor, cls)

        if limit != 0:
            generator.set_limit(limit)

        generators.append(generator)

    obj = cls(cls_descriptor.name, *generators)
    return obj