def custom_cmp(self, x, y):
    if (x.time < y.time):
        return (- 1)
    elif (x.time > y.time):
        return 1
    elif (x.start_time < y.start_time):
        return (- 1)
    elif (x.start_time > y.start_time):
        return 1
    else:
        return 0
def custom_cmp(self, x, y):
    if (x.time < y.time):
        return (- 1)
    elif (x.time > y.time):
        return 1
    elif (x.start_time < y.start_time):
        return (- 1)
    elif (x.start_time > y.start_time):
        return 1
    else:
        return 0