def METHOD_NAME(self, tstamp: Optional[datetime]) -> Optional[int]:
    """
    Upon driving layer change find the nearest past tstamp in the new driving
    layer and return its index.
    """
    if tstamp is None:
        return None
    old_tstamp_np = np.asarray([tstamp])
    other_timeline_np = np.asarray(self.timeline)
    past_idcs = other_timeline_np <= old_tstamp_np
    distances = np.abs(other_timeline_np[past_idcs] - old_tstamp_np)
    if distances.size > 0:
        return np.argmin(distances)
    else:
        return None