def threshold(value, target=0.1, scaling=1.0):
    """

    measure the deviation from flow

    Parameters
    ----------
    value
        value whose diviation should be measured
    target
        threshold value
    scaling
        scaling factor

    Returns
    -------
    performace
        diviation scale

    """
    performance = 0.0
    if value <= target:
        performance += 0.0
    else:
        performance += (value - target) * scaling
    return performance
