from typing import List
from typing import Tuple


def start_end_locations_from_locations(
    locations: List[float],
) -> Tuple[List[float], List[float]]:
    """
    Calculates the start and end times of each location

    Ex) 5, 10, 15
        start_times == 5, 10, 15
        end_times == 10, 15, 15

    Returns
    -------
    A tuple of start and end times
    """
    start_locations = []
    end_locations = []

    for index, location in enumerate(locations):
        start_time = location
        if index == len(locations) - 1:
            end_time = location
        else:
            end_time = locations[index + 1]

        start_locations.append(start_time)
        end_locations.append(end_time)

    return start_locations, end_locations