Get an OP_QUERY message.
765311
def _query(options, collection_name, num_to_skip,
           num_to_return, query, field_selector, opts, check_keys):
    """"""
    encoded = _dict_to_bson(query, check_keys, opts)
    if field_selector:
        efs = _dict_to_bson(field_selector, False, opts)
    else:
        efs = b""
    max_bson_size = max(len(encoded), len(efs))
    return b"".join([
        _pack_int(options),
        _make_c_string(collection_name),
        _pack_int(num_to_skip),
        _pack_int(num_to_return),
        encoded,
        efs]), max_bson_size
575764
def _query_compressed(options, collection_name, num_to_skip,
                      num_to_return, query, field_selector,
                      opts, check_keys=False, ctx=None):
    """"""
    op_query, max_bson_size = _query(
        options,
        collection_name,
        num_to_skip,
        num_to_return,
        query,
        field_selector,
        opts,
        check_keys)
    rid, msg = _compress(2004, op_query, ctx)
    return rid, msg, max_bson_size
912405
def post(ctx, odm):
    """"""
    try:
        ctx.obj['RWS'].send_request(PostDataRequest(odm.read()))
        if ctx.obj['RAW']:
            click.echo(ctx.obj['RWS'].last_result.text)
    except RWSException as e:
        click.echo(e.message)
209354
def _op_msg_uncompressed(flags, command, identifier, docs, check_keys, opts):
    """"""
    data, total_size, max_bson_size = _op_msg_no_header(
        flags, command, identifier, docs, check_keys, opts)
    request_id, op_message = __pack_message(2013, data)
    return request_id, op_message, total_size, max_bson_size
1301064
def get_message(self, dummy0, sock_info, use_cmd=False):
        """"""

        ns = self.namespace()
        ctx = sock_info.compression_context

        if use_cmd:
            spec = self.as_command(sock_info)[0]
            if sock_info.op_msg_enabled:
                request_id, msg, size, _ = _op_msg(
                    0, spec, self.db, ReadPreference.PRIMARY,
                    False, False, self.codec_options,
                    ctx=sock_info.compression_context)
                return request_id, msg, size
            ns = _UJOIN % (self.db, "$cmd")
            return query(0, ns, 0, -1, spec, None, self.codec_options, ctx=ctx)

        return get_more(ns, self.ntoreturn, self.cursor_id, ctx)
1159878
def getOperation(self, ps, address):
        ''' 
        '''
        action = address.getAction()
        opName = self.getOperationName(ps, action)
        return getattr(self, opName)
685943
def _query(self, cmd, *datas):
        """"""
        cmd = Command(query=cmd)
        return cmd.query(self._transport, self._protocol, *datas)
1273834
def _get_query(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        return self._send_query(do_post=False, **param_dict)
1222557
def getOperation(self, ps, action):
        '''
        '''
        opName = self.getOperationName(ps, action)
        return getattr(self, opName)
586270
def handle_query_error(msg, query, session, payload=None):
    """"""
    payload = payload or {}
    troubleshooting_link = config['TROUBLESHOOTING_LINK']
    query.error_message = msg
    query.status = QueryStatus.FAILED
    query.tmp_table_name = None
    session.commit()
    payload.update({
        'status': query.status,
        'error': msg,
    })
    if troubleshooting_link:
        payload['link'] = troubleshooting_link
    return payload
107482
def annotate_op(self, op):
        

        if isinstance(op, Label):
            return op
        else:
            return AnnotatedOp(self, op.name, op.arg)
1295558
def OnOk(self, event):
        """"""

        # Get key values from textctrls

        key_strings = [self.row_textctrl.GetValue(),
                       self.col_textctrl.GetValue(),
                       self.tab_textctrl.GetValue()]

        key = []

        for key_string in key_strings:
            try:
                key.append(int(key_string))
            except ValueError:
                key.append(0)

        # Post event

        post_command_event(self.parent, self.GotoCellMsg, key=tuple(key))
1366846
def simxAddStatusbarMessage(clientID, message, operationMode):
    '''
    
    '''

    if (sys.version_info[0] == 3) and (type(message) is str):
        message=message.encode('utf-8')
    return c_AddStatusbarMessage(clientID, message, operationMode)
816913
def op_at_code_loc(code, loc, opc):
    
    try:
        op = code[loc]
    except IndexError:
        return 'got IndexError'
    return opc.opname[op]
747646
def _get(self, operation, field):
        """"""
        self._check_exists()
        query = {Mark.FLD_OP: operation.name,
                 Mark.FLD_MARK + "." + field: {"$exists": True}}
        return self._track.find_one(query)
262823
def _query_service(self, name):
        """"""
        if self.query_cmd:
            try:
                return sos_get_command_output("%s %s" % (self.query_cmd, name))
            except Exception:
                return None
        return None
1062567
def get_or_none(cls, mp, part_number):
        """"""
        return cls.query.filter_by(
            upload_id=mp.upload_id,
            part_number=part_number
        ).one_or_none()