def p(x, threshold=0.5):
    """Predicts whether a probability falls into class 1.

    Args:
        x (obj): Probability that example belongs to class 1.
        threshold (float): point above which a probability is deemed of class
            1.

    Returns:
        int: Binary value to denote class 1 or 0
    """
    prediction = None
    if x >= threshold:
        prediction = 1
    else:
        prediction = 0

    return prediction