def is_valid_loss(instance):
    """semantic:
    None: don't set any netem loss rule
    x: set a rule with x% loss
    """
    if instance is None:
        return True
    if isinstance(instance, float) or isinstance(instance, int):
        return True
    if instance <= 1 and instance >= 0:
        return True
    return False