def get_average_weekly_stream_traffic(stream_id: int, stream_date_created: datetime.datetime, recent_traffic: Dict[(int, int)]) -> Optional[int]:
    try:
        stream_traffic = recent_traffic[stream_id]
    except KeyError:
        stream_traffic = 0
    stream_age = (timezone_now() - stream_date_created).days
    if (stream_age >= 28):
        average_weekly_traffic = int((stream_traffic // 4))
    elif (stream_age >= STREAM_TRAFFIC_CALCULATION_MIN_AGE_DAYS):
        average_weekly_traffic = int(((stream_traffic * 7) // stream_age))
    else:
        return None
    if ((average_weekly_traffic == 0) and (stream_traffic > 0)):
        average_weekly_traffic = 1
    return round_to_2_significant_digits(average_weekly_traffic)
def get_average_weekly_stream_traffic(stream_id: int, stream_date_created: datetime.datetime, recent_traffic: Dict[(int, int)]) -> Optional[int]:
    try:
        stream_traffic = recent_traffic[stream_id]
    except KeyError:
        stream_traffic = 0
    stream_age = (timezone_now() - stream_date_created).days
    if (stream_age >= 28):
        average_weekly_traffic = int((stream_traffic // 4))
    elif (stream_age >= STREAM_TRAFFIC_CALCULATION_MIN_AGE_DAYS):
        average_weekly_traffic = int(((stream_traffic * 7) // stream_age))
    else:
        return None
    if ((average_weekly_traffic == 0) and (stream_traffic > 0)):
        average_weekly_traffic = 1
    return round_to_2_significant_digits(average_weekly_traffic)