def eval(self, t, allow_muting=True):
    if (self.muted and allow_muting):
        return 0
    if (not self.points):
        raise ValueError('curve has no points')
    i = (bisect_left(self.points, (t, None)) - 1)
    if (i == (- 1)):
        return self.points[0][1]
    if (self.points[i][0] > t):
        return self.points[i][1]
    if (i >= (len(self.points) - 1)):
        return self.points[i][1]
    (p1, p2) = (self.points[i], self.points[(i + 1)])
    frac = ((t - p1[0]) / (p2[0] - p1[0]))
    y = (p1[1] + ((p2[1] - p1[1]) * frac))
    return y
def eval(self, t, allow_muting=True):
    if (self.muted and allow_muting):
        return 0
    if (not self.points):
        raise ValueError('curve has no points')
    i = (bisect_left(self.points, (t, None)) - 1)
    if (i == (- 1)):
        return self.points[0][1]
    if (self.points[i][0] > t):
        return self.points[i][1]
    if (i >= (len(self.points) - 1)):
        return self.points[i][1]
    (p1, p2) = (self.points[i], self.points[(i + 1)])
    frac = ((t - p1[0]) / (p2[0] - p1[0]))
    y = (p1[1] + ((p2[1] - p1[1]) * frac))
    return y