import math


def _parseSeconds(data):
    """
    Formats a number of seconds into format HH:MM:SS.XXXX
    """
    total_seconds = data.total_seconds()
    hours = math.floor(total_seconds / 3600)
    minutes = math.floor((total_seconds - hours * 3600) / 60)
    seconds = math.floor(total_seconds - hours * 3600 - minutes * 60)
    remainder = total_seconds - 3600 * hours - 60 * minutes - seconds
    return "%02d:%02d:%02d%s" % (
        hours,
        minutes,
        seconds,
        (".%s" % str(round(remainder, 8))[2:]) if remainder > 0 else "",
    )