@addon_view_with_unlisted
@non_atomic_requests
def usage_series(request, addon, group, start, end, format):
    date_range = check_series_params_or_404(group, start, end, format)
    check_stats_permission(request, addon)

    series = get_series(
        ThemeUserCount if addon.type == amo.ADDON_PERSONA else UpdateCount,
        addon=addon.id, date__range=date_range)

    if format == 'csv':
        return render_csv(request, addon, series, ['date', 'count'])
    elif format == 'json':
        return render_json(request, addon, series)
Return a suitable environment dict based on user input & behavior.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/stats/views.py/usage_series--crossover with--dataset/ETHPy150Open pyinvoke/invoke/invoke/runners.py/Runner.generate_env