def cond(x, singular=False, order=0):
    """
    If It is singular, return 1 if x>0 else 0.
    If It is not singular, return x**order if x>0 else 0
    """
    if singular:
        return 1 if x > 0 else 0
    return x ** order if x > 0 else 0
