import random


def _chance_test(chance):
    """
    Tests whether or not we should switch for a given chance percentage
    0 <= chance <= 1
    """
    return True if random.random() < chance else False