def METHOD_NAME(self, time):
    """Returns (time, measnum, beat, num, den) for the beat at time."""
    if not self.beats:
        return (0, 0, 0, 4, 2)
    pos = 0
    if time:
        # bisect our way in the beats list.
        end = len(self.beats)
        while pos < end:
            mid = (pos + end) // 2
            if time > self.beats[mid][0]:
                pos = mid + 1
            else:
                end = mid
    return self.beats[min(pos, len(self.beats) - 1)]