A negated query is one in which every clause has a presence of
        prohibited. These queries require some special processing to return
        the expected results.
7633
def is_negated(self):
        
        return all(
            clause.presence == QueryPresence.PROHIBITED for clause in self.clauses
        )
958682
public static Predicate not(final Predicate childPredicate) {
        return new Predicate() {
            public void init(AbstractSqlCreator creator) {
                childPredicate.init(creator);
            }
            public String toSql() {
                return "not (" + childPredicate.toSql() + ")";
            }
        };
    }
565269
def without(*conditions, &block)
      @filters ||= []

      @filters << {:negate => true, :filter => block} if block
      conditions.each do |condition|
        @filters << {:negate => true, :filter => condition}
      end
    end
1093633
def process_query(self):
		
		self.query = wt(self.query)
		self.processed_query = []
		for word in self.query:
			if word not in self.stop_words and word not in self.punctuation:
				self.processed_query.append(self.stemmer.stem(word))
876265
def wherenotin(self, fieldname, value):
        
        return self.wherein(fieldname, value, negate=True)
404155
def check_negated_goals(self,safe_variables,query):
        '''  '''
        variables_in_negated_goals = \
            [y for x in query.relations for y in list(x.variables) if x.is_negated()]

        # And check them:
        for variable in variables_in_negated_goals:
            if not (variable in safe_variables):
                raise NotSafeException('Query not safe because ' + \
                    variable.name + \
                    ' from a negated goal does not occur in a positive goal')
                return False

        return True
649648
def disallowed_table(*tables):
    """"""
    # XXX: When using a black or white list, this has to be done EVERY query;
    # It'd be nice to make this as fast as possible.  In general, queries
    # should have relatively few tables involved, and I don't imagine that
    # blacklists would grow very vast.  The fastest i've been able to come
    # up with is to pre-create a blacklist set and use intersect.
    return not bool(settings.WHITELIST.issuperset(tables)) if settings.WHITELIST\
        else bool(settings.BLACKLIST.intersection(tables))
74453
@Deprecated
    public C expectAtLeast(int allowedStatements, Query query) {
        return expect(SqlQueries.minQueries(allowedStatements).type(adapter(query)));
    }
1024042
protected function exceptionIfNotQuery()
    {
        if (!$this->isQuery()) {
            throw new RuntimeException(
                Message::get(Message::DB_SQL_NOT_QUERY),
                Message::DB_SQL_NOT_QUERY
            );
        }
    }
1136231
def Negation(expr: Expression) -> Expression:
    """"""
    expr = Expression(_negate(expr.body))
    return ast.fix_missing_locations(expr)
101520
public static Query not(Query query) {
        Query q = new Query(false);
        q.add("$not", query.toJson());
        return q;
    }
37703
private void validateQuery(Query query) throws IllegalArgumentException {
    if (query.getKindCount() != 1) {
      throw new IllegalArgumentException("Query must have exactly one kind.");
    }
    if (query.getOrderCount() != 0) {
      throw new IllegalArgumentException("Query cannot have any sort orders.");
    }
    if (query.hasFilter()) {
      validateFilter(query.getFilter());
    }
  }
1335872
def _query_uncompressed(options, collection_name, num_to_skip,
          num_to_return, query, field_selector, opts, check_keys=False):
    """"""
    op_query, max_bson_size = _query(
        options,
        collection_name,
        num_to_skip,
        num_to_return,
        query,
        field_selector,
        opts,
        check_keys)
    rid, msg = __pack_message(2004, op_query)
    return rid, msg, max_bson_size
789597
def exclude(self, *args, **kwargs) -> "QuerySet":
        
        return self._filter_or_exclude(negate=True, *args, **kwargs)
1325896
def negated(input_words, include_nt=True):
    
    input_words = [str(w).lower() for w in input_words]
    neg_words = []
    neg_words.extend(NEGATE)
    for word in neg_words:
        if word in input_words:
            return True
    if include_nt:
        for word in input_words:
            if "n't" in word:
                return True
    if "least" in input_words:
        i = input_words.index("least")
        if i > 0 and input_words[i - 1] != "at":
            return True
    return False
879168
public QueryBuilder exceptAll() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.EXCEPT;
        this.firstQueryAll = true;
        clear(false);
        return this;
    }
1337479
public final QueryParser.not_return not() throws RecognitionException {
        QueryParser.not_return retval = new QueryParser.not_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token NOT15=null;
        Token WS16=null;
        QueryParser.not_return not17 = null;

        QueryParser.primary_return primary18 = null;


        CommonTree NOT15_tree=null;
        CommonTree WS16_tree=null;

        try {
            // src/riemann/Query.g:32:5: ( NOT ( WS )* ( not | primary ) )
            // src/riemann/Query.g:32:7: NOT ( WS )* ( not | primary )
            {
            root_0 = (CommonTree)adaptor.nil();

            NOT15=(Token)match(input,NOT,FOLLOW_NOT_in_not216); 
            NOT15_tree = (CommonTree)adaptor.create(NOT15);
            root_0 = (CommonTree)adaptor.becomeRoot(NOT15_tree, root_0);

            // src/riemann/Query.g:32:12: ( WS )*
            loop9:
            do {
                int alt9=2;
                int LA9_0 = input.LA(1);

                if ( (LA9_0==WS) ) {
                    alt9=1;
                }


                switch (alt9) {
            	case 1 :
            	    // src/riemann/Query.g:32:12: WS
            	    {
            	    WS16=(Token)match(input,WS,FOLLOW_WS_in_not219); 
            	    WS16_tree = (CommonTree)adaptor.create(WS16);
            	    adaptor.addChild(root_0, WS16_tree);


            	    }
            	    break;

            	default :
            	    break loop9;
                }
            } while (true);

            // src/riemann/Query.g:32:16: ( not | primary )
            int alt10=2;
            int LA10_0 = input.LA(1);

            if ( (LA10_0==NOT) ) {
                alt10=1;
            }
            else if ( (LA10_0==TAGGED||LA10_0==25||(LA10_0>=27 && LA10_0<=38)) ) {
                alt10=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 10, 0, input);

                throw nvae;
            }
            switch (alt10) {
                case 1 :
                    // src/riemann/Query.g:32:17: not
                    {
                    pushFollow(FOLLOW_not_in_not223);
                    not17=not();

                    state._fsp--;

                    adaptor.addChild(root_0, not17.getTree());

                    }
                    break;
                case 2 :
                    // src/riemann/Query.g:32:23: primary
                    {
                    pushFollow(FOLLOW_primary_in_not227);
                    primary18=primary();

                    state._fsp--;

                    adaptor.addChild(root_0, primary18.getTree());

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }