def normalise_time(time_str):
    """
    Some of the raw Dublin Bus data has invalid times for hours after midnight
    (e.g., 25:00 for 1am). This function corrects any time string with this
    problem so that we can work with it using Pandas datetimes

    Args
    ---
        time_str: str
            A time as a string

    Returns
    ---
    A time string with only the hour corrected if necessary
    """

    hour = time_str.split(":")[0]
    if int(hour) >= 24:
        normalised_hour = int(hour) % 24
        return time_str.replace(hour, f"{normalised_hour:02}")

    return time_str