def formated_timedelta(total_seconds):
    """
    Format time delta as H:M:S\

    :param total_seconds: from timedelta.totalseconds
    :return: formatted string
    """
    if isinstance(total_seconds, str):
        parts = total_seconds.split(':')
        if len(parts) > 1:
            # Assume already formatted
            return total_seconds
        try:
            # Assume an integer as a string
            total_seconds = int(total_seconds)
        except ValueError:
            # Don't know what this is, just return as is
            return total_seconds
    hours = int(total_seconds // 3600)
    minutes = int((total_seconds % 3600) // 60)
    seconds = int(total_seconds % 60)
    return f'{hours}:{minutes}:{seconds}'