def remove_invalid_fields(self, queryset, fields, view):
        # get valid field names for sorting
        valid_fields_map = {
            name: source for name, label, source in self.get_valid_fields(
                queryset, view)
        }

        valid_orderings = []
        invalid_orderings = []

        # for each field sent down from the query param,
        # determine if its valid or invalid
        for term in fields:
            stripped_term = term.lstrip('-')
            # add back the '-' add the end if necessary
            reverse_sort_term = '' if len(stripped_term) is len(term) else '-'
            if stripped_term in valid_fields_map:
                name = reverse_sort_term + valid_fields_map[stripped_term]
                valid_orderings.append(name)
            else:
                invalid_orderings.append(term)

        return valid_orderings, invalid_orderings
Use Popen to execute `seq` and return stdout.
dataset/ETHPy150Open AltSchool/dynamic-rest/dynamic_rest/filters.py/DynamicSortingFilter.remove_invalid_fields--crossover with--dataset/ETHPy150Open peterbe/bgg/bgg/lib/start.py/call