def METHOD_NAME(self, instance, **kwargs):
    config = self.CONFIG(kwargs)
    if config.tmp and not hasattr(instance, '_tmp_trivial_deactivated_constrs'):
        instance._tmp_trivial_deactivated_constrs = ComponentSet()
    elif config.tmp:
        logger.warning(
            'Deactivating trivial constraints on the block {} for which '
            'trivial constraints were previously deactivated. '
            'Reversion will affect all deactivated constraints.'.format(
                instance.name
            )
        )
    # Trivial constraints are those that do not contain any variables, ie.
    # the polynomial degree is 0
    for constr in instance.component_data_objects(
        ctype=Constraint, active=True, descend_into=True
    ):
        repn = generate_standard_repn(constr.body)
        if not repn.is_constant():
            # This constraint is not trivial
            continue
        # We need to check each constraint to sure that it is not violated.
        constr_lb = value(constr.lower) if constr.has_lb() else float('-inf')
        constr_ub = value(constr.upper) if constr.has_ub() else float('inf')
        constr_value = repn.constant
        # Check if the lower bound is violated outside a given tolerance
        if constr_value + config.tolerance <= constr_lb:
            if config.ignore_infeasible:
                continue
            else:
                raise InfeasibleConstraintException(
                    'Trivial constraint {} violates LB {} ≤ BODY {}.'.format(
                        constr.name, constr_lb, constr_value
                    )
                )
        # Check if the upper bound is violated outside a given tolerance
        if constr_value >= constr_ub + config.tolerance:
            if config.ignore_infeasible:
                continue
            else:
                raise InfeasibleConstraintException(
                    'Trivial constraint {} violates BODY {} ≤ UB {}.'.format(
                        constr.name, constr_value, constr_ub
                    )
                )
        # Constraint is not infeasible. Deactivate it.
        if config.tmp:
            instance._tmp_trivial_deactivated_constrs.add(constr)
        config.return_trivial.append(constr)
        constr.deactivate()