import random


def random_bool(true_p=0.5):
    """Generate true of false randomly

    Args:
        true_p (float): Probability of generating true

    Returns:
        bool: True or false
    """
    return random.random() <= true_p