def filter(self, *args, **kwargs):
<EOL>if len([x for x in kwargs.values() if x is None]):<EOL><INDENT>raise CQLEngineException("<STR_LIT>")<EOL><DEDENT>clone = copy.deepcopy(self)<EOL>for operator in args:<EOL><INDENT>if not isinstance(operator, WhereClause):<EOL><INDENT>raise QueryException('<STR_LIT>'.format(operator))<EOL><DEDENT>clone._where.append(operator)<EOL><DEDENT>for arg, val in kwargs.items():<EOL><INDENT>col_name, col_op = self._parse_filter_arg(arg)<EOL>quote_field = True<EOL>try:<EOL><INDENT>column = self.model._get_column(col_name)<EOL><DEDENT>except KeyError:<EOL><INDENT>if col_name == '<STR_LIT>':<EOL><INDENT>if not isinstance(val, Token):<EOL><INDENT>raise QueryException("<STR_LIT>")<EOL><DEDENT>column = columns._PartitionKeysToken(self.model)<EOL>quote_field = False<EOL><DEDENT>else:<EOL><INDENT>raise QueryException("<STR_LIT>".format(col_name))<EOL><DEDENT><DEDENT>if isinstance(val, Token):<EOL><INDENT>if col_name != '<STR_LIT>':<EOL><INDENT>raise QueryException("<STR_LIT>")<EOL><DEDENT>partition_columns = column.partition_columns<EOL>if len(partition_columns) != len(val.value):<EOL><INDENT>raise QueryException(<EOL>'<STR_LIT>'.format(<EOL>len(val.value), len(partition_columns)))<EOL><DEDENT>val.set_columns(partition_columns)<EOL><DEDENT>operator_class = BaseWhereOperator.get_operator(col_op or '<STR_LIT>')<EOL>operator = operator_class()<EOL>if isinstance(operator, InOperator):<EOL><INDENT>if not isinstance(val, (list, tuple)):<EOL><INDENT>raise QueryException('<STR_LIT>')<EOL><DEDENT>query_val = [column.to_database(v) for v in val]<EOL><DEDENT>elif isinstance(val, BaseQueryFunction):<EOL><INDENT>query_val = val<EOL><DEDENT>else:<EOL><INDENT>query_val = column.to_database(val)<EOL><DEDENT>clone._where.append(WhereClause(column.db_field_name, operator, query_val, quote_field=quote_field))<EOL><DEDENT>return clone<EOL>
Adds WHERE arguments to the queryset, returning a new queryset

#TODO: show examples

:rtype: AbstractQuerySet