def signals_blocker(instance, attribute, *args, **kwargs):
    """
    Blocks given instance signals before calling the given attribute with \
    given arguments and then unblocks the signals.

    :param instance: Instance object.
    :type instance: QObject
    :param attribute: Attribute to call.
    :type attribute: QObject
    :param \*args: Arguments.
    :type \*args: \*
    :param \*\*kwargs: Keywords arguments.
    :type \*\*kwargs: \*\*
    :return: Object.
    :rtype: object
    """

    value = None
    try:
        hasattr(instance, "blockSignals") and instance.blockSignals(True)
        value = attribute(*args, **kwargs)
    finally:
        hasattr(instance, "blockSignals") and instance.blockSignals(False)
        return value
Blocks given instance signals before calling the given attribute with \
    given arguments and then unblocks the signals.

    :param instance: Instance object.
    :type instance: QObject
    :param attribute: Attribute to call.
    :type attribute: QObject
    :param \*args: Arguments.
    :type \*args: \*
    :param \*\*kwargs: Keywords arguments.
    :type \*\*kwargs: \*\*
    :return: Object.
    :rtype: object