def _milliseconds_to_hms(milliseconds):
    """Takes a number of milliseconds and turns it into hours, minutes and seconds

    Args:
        milliseconds: (int) number of milliseconds to convert

    Returns:
        A tuple (hours, minutes, seconds)
    """

    seconds, _ = divmod(milliseconds, 1000)
    minutes, seconds = divmod(seconds, 60)
    hours, minutes = divmod(minutes, 60)
    return (hours, minutes, seconds)