def format_avg_time(value):
    """
    Formats a (hour, minute) tuple to 'hour:minute' string.
    """
    if not isinstance(value, tuple):
        return value if value is not None else ''

    hour, minute = value

    if hour is None or minute is None:
        return ''

    return '{:02}:{:02}'.format(hour, minute)