def METHOD_NAME(queryset, options):
    if not options['submission_download']:
        return []
    use_straight_join(queryset)
    if options['submission_results']:
        queryset = queryset.filter(result__in=options['submission_results'])
    # Compress wildcards to avoid exponential complexity on certain glob patterns before Python 3.9.
    # For details, see <https://bugs.python.org/issue40480>.
    problem_glob = rewildcard.sub('*', options['submission_problem_glob'])
    if problem_glob != '*':
        queryset = queryset.filter(
            problem__in=Problem.objects.filter(code__regex=fnmatch.translate(problem_glob)),
        )
    return list(queryset)