def METHOD_NAME(request, build_id, values):
    """
    Description: Updates the fields of the selected build or builds.
    :param int build_id: the build ID.
    :param dict values: a mapping containing build information to update.
        * product: (int or str) optional new product ID or name.
        * name: (str) optional new build name.
        * description: (str) optional new description.
        * is_active: (bool) set active or not optionally.
    :return: a mapping serialized from the updated :class:`TestBuild` object.
    :rtype: dict
    Example::
        # Update name to 'foo' for build id 702
        Build.update(702, {'name': 'foo'})
        # Update status to inactive for build id 702
        Build.update(702, {'is_active': 0})
    """
    tb = TestBuild.objects.get(build_id=build_id)
    if not values:
        return tb.serialize()
    def _update_value(obj, name, value):
        setattr(obj, name, value)
        update_fields.append(name)
    update_fields = list()
    if values.get("product"):
        _update_value(tb, "product", pre_check_product(values))
    if values.get("name"):
        _update_value(tb, "name", values["name"])
    if values.get("description"):
        _update_value(tb, "description", values["description"])
    if values.get("is_active") is not None:
        _update_value(tb, "is_active", parse_bool_value(values.get("is_active", True)))
    tb.save(update_fields=update_fields)
    return tb.serialize()