import numpy as np

def safety_function(observations):
    """
    This function returns 1 if the reward (Acrobot height ) is  above 3
     and 0 if not
    """
    cost = 2 - (observations[:, 0] +
                  observations[:, 0] * observations[:, 2] -
                  observations[:, 1] * observations[:, 3])

    return cost > 3