def filter_queryset(self, request, term, queryset=None, **dependent_fields):
if queryset is None:<EOL><INDENT>queryset = self.get_queryset()<EOL><DEDENT>search_fields = self.get_search_fields()<EOL>select = Q()<EOL>term = term.replace('<STR_LIT:\t>', '<STR_LIT:U+0020>')<EOL>term = term.replace('<STR_LIT:\n>', '<STR_LIT:U+0020>')<EOL>for t in [t for t in term.split('<STR_LIT:U+0020>') if not t == '<STR_LIT>']:<EOL><INDENT>select &= reduce(lambda x, y: x | Q(**{y: t}), search_fields,<EOL>Q(**{search_fields[<NUM_LIT:0>]: t}))<EOL><DEDENT>if dependent_fields:<EOL><INDENT>select &= Q(**dependent_fields)<EOL><DEDENT>return queryset.filter(select).distinct()<EOL>
Return QuerySet filtered by search_fields matching the passed term.

Args:
    request (django.http.request.HttpRequest): The request is being passed from
        the JSON view and can be used to dynamically alter the response queryset.
    term (str): Search term
    queryset (django.db.models.query.QuerySet): QuerySet to select choices from.
    **dependent_fields: Dependent fields and their values. If you want to inherit
        from ModelSelect2Mixin and later call to this method, be sure to pop
        everything from keyword arguments that is not a dependent field.

Returns:
    QuerySet: Filtered QuerySet