def METHOD_NAME(start_date, end_date, utc_offset):
    queryset = Submission.objects.filter(date__gte=start_date, date__lte=end_date)
    submissions = (
        queryset.annotate(date_only=Cast(F('date') + utc_offset, DateField()))
        .values('date_only', 'result').annotate(count=Count('result')).values_list('date_only', 'result', 'count')
    )
    languages = (
        queryset.values('language__name').annotate(count=Count('language__name'))
        .filter(count__gt=0).order_by('-count').values_list('language__name', 'count')
    )
    results = (
        queryset.values('result').annotate(count=Count('result'))
        .filter(count__gt=0).order_by('-count').values_list('result', 'count')
    )
    results = [(str(Submission.USER_DISPLAY_CODES[res]), count) for (res, count) in results]
    queue_time = (
        # Divide by 1000000 to convert microseconds to seconds
        queryset.filter(judged_date__isnull=False, rejudged_date__isnull=True)
        .annotate(queue_time=Cast(F('judged_date') - F('date'), FloatField()) / 1000000.0)
        .order_by('queue_time').values_list('queue_time', flat=True)
    )
    days_labels = generate_day_labels(start_date, end_date, utc_offset)
    num_days = len(days_labels)
    result_order = ['AC', 'WA', 'TLE', 'CE', 'ERR']
    result_data = {result: [0] * num_days for result in result_order}
    for date, result, count in submissions:
        result_data[result if result in result_order else 'ERR'][days_labels.index(date.isoformat())] += count
    queue_time_ranges = [0, 1, 2, 5, 10, 30, 60, 120, 300, 600]
    queue_time_labels = [
        '',
        '0s - 1s',
        '1s - 2s',
        '2s - 5s',
        '5s - 10s',
        '10s - 30s',
        '30s - 1min',
        '1min - 2min',
        '2min - 5min',
        '5min - 10min',
        '> 10min',
    ]
    def binning(x):
        return bisect.bisect_left(queue_time_ranges, x, lo=0, hi=len(queue_time_ranges))
    queue_time_count = [0] * len(queue_time_labels)
    for group in map(binning, list(queue_time)):
        queue_time_count[group] += 1
    queue_time_data = [(queue_time_labels[i], queue_time_count[i]) for i in range(1, len(queue_time_labels))]
    return {
        'by_day': get_stacked_bar_chart(days_labels, result_data, settings.DMOJ_STATS_SUBMISSION_RESULT_COLORS),
        'by_language': get_pie_chart(languages),
        'result': get_pie_chart(results),
        'queue_time': get_bar_chart(queue_time_data),
    }