Sets the query that is used for this widget to the inputed query.
        
        :param      query | (<str> term, <str> operator, <str> value)
        
        :return     <bool> | success
777498
def setQuery( self, query ):
        
        if ( not (type(query) in (list, tuple) and len(query) == 3) ):
            return False
        
        term, op, value = query
        
        if ( self.currentRule() ):
            op = self.currentRule().operatorLabel(op)
        
        self.uiTermDDL.setCurrentIndex(self.uiTermDDL.findText(term))
        self.applyRule()
        
        self.uiOperatorDDL.setCurrentIndex(self.uiOperatorDDL.findText(op))
        
        widget = self.uiWidgetAREA.widget()
        if ( widget and not type(widget) == QWidget ):
            widget.setText(value)
        
        return True
454786
def raw_query(self, query, query_parameters=None):
        
        self.assert_no_raw_query()

        if len(self._where_tokens) != 0 or len(self._select_tokens) != 0 or len(
                self._order_by_tokens) != 0 or len(self._group_by_tokens) != 0:
            raise InvalidOperationException(
                "You can only use raw_query on a new query, without applying any operations "
                "(such as where, select, order_by, group_by, etc)")

        if query_parameters:
            self.query_parameters = query_parameters
        self._query = query
        return self
653359
def query(self, term):
        
        results = []
        command = ["query", "--current-patch-set", "--all-approvals",
                   "--format JSON", "--commit-message"]

        if not isinstance(term, basestring):
            raise ValueError("term must be a string")

        command.append(escape_string(term))
        result = self._ssh_client.run_gerrit_command(" ".join(command))
        decoder = JSONDecoder()
        for line in result.stdout.read().splitlines():
            # Gerrit's response to the query command contains one or more
            # lines of JSON-encoded strings.  The last one is a status
            # dictionary containing the key "type" whose value indicates
            # whether or not the operation was successful.
            # According to http://goo.gl/h13HD it should be safe to use the
            # presence of the "type" key to determine whether the dictionary
            # represents a change or if it's the query status indicator.
            try:
                data = decoder.decode(line)
            except ValueError as err:
                raise GerritError("Query returned invalid data: %s", err)
            if "type" in data and data["type"] == "error":
                raise GerritError("Query error: %s" % data["message"])
            elif "project" in data:
                results.append(Change(data))
        return results
1235331
def setTerms( self, terms ):
        
        return self.setRules([XQueryRule(term = term) for term in terms])
1225859
public void setQuery(String query) throws PageException {
	this.query = Caster.toQuery(pageContext.getVariable(query));
    }
199697
def tokenize_query(query: str) -> Dict[str, Iterable]:
    
    expressions = split_query(query)
    name_operation_tuples = [parse_expression(expression) for expression in expressions]
    operation_by_name = defaultdict(list)
    for name, operation in name_operation_tuples:
        operation_by_name[name].append(operation)
    return operation_by_name
537702
def scoped_query(query)
      if query.kind_of?(Query)
        query.dup
      else
        self.query.relative(query)
      end
    end
894595
def query(cls, name=None, offset=None, limit=None, api=None):
        

        api = api or cls._API
        return super(Automation, cls)._query(
            url=cls._URL['query'],
            name=name,
            offset=offset,
            limit=limit,
            api=api,
        )
239034
def paginate_query(self, query):
        

        if self.paginator is None:
            return None

        return self.paginator.paginate_query(query, self.request)
1222351
def query(self, query_str, *query_args, **query_options):
        
        with self.connection(**query_options) as connection:
            query_options['connection'] = connection
            return self._query(query_str, query_args, **query_options)
431226
def match(self, query_dict=None, **query):
        
        if query_dict:
            self._q.append({'$match': query_dict})
        else:
            self._q.append({'$match': query})
        return self
147712
def matches_query(self, key, query):
        
        dumped = query.dump()
        dumped['className'] = query._query_class._class_name
        self._add_condition(key, '$inQuery', dumped)
        return self
762665
def setQuery(self, query, autoRefresh=True):
        
        self._query = query
        
        tableType = self.tableType()
        if not tableType:
            return False
        
        if autoRefresh:
            self.refresh(tableType.select(where = query))
        
        return True
1112167
def validate_query(query):
        
        tokens = _quote_re.findall(query)
        for token in tokens:
            if token.startswith('"') and token.endswith('"'):
                continue
            if set(token) & _invalid_ascii:
                return False
        return True
759515
def qs_set(self, *args, **kwargs):
        ''''''
        if args and kwargs:
            raise TypeError('Use positional args or keyword args not both')
        query = self.query.copy()
        if args:
            mdict = MultiDict(args[0])
            for k in mdict.keys():
                if k in query:
                    del query[k]
            for k, v in mdict.items():
                query.add(k, v)
        else:
            for k, v in kwargs.items():
                query[k] = v
        return self._copy(query=query)
1100187
private void setQuery(CharSequence query) {
        mQueryTextView.setText(query);
        // Move the cursor to the end
        mQueryTextView.setSelection(TextUtils.isEmpty(query) ? 0 : query.length());
    }
253249
public function setQuery($query)
    {
        if (is_string($query) || $query instanceof \OtherCode\Database\Query\Query) {
            $this->query = $query;
        }
        return $this;
    }