accepts a statement and adds a qualifer setting the mrt
        modifies s in place
        :param s: a WDBaseDataType statement
        :param mrt: one of {'close', 'broad', 'exact', 'related', 'narrow'}
        :return: s
196868
def set_mrt(self, s, mrt: str):
        
        valid_mrts_abv = self.ABV_MRT.keys()
        valid_mrts_uri = self.ABV_MRT.values()
        if mrt in valid_mrts_abv:
            mrt_uri = self.ABV_MRT[mrt]
        elif mrt in valid_mrts_uri:
            mrt_uri = mrt
        else:
            raise ValueError("mrt must be one of {}, found {}".format(valid_mrts_abv, mrt))
        mrt_qid = self.mrt_qids[mrt_uri]

        q = wdi_core.WDItemID(mrt_qid, self.mrt_pid, is_qualifier=True)
        s.qualifiers.append(q)
        return s
387293
def p_statement(self, p):
        
        p[0] = ['statement', p[1][0], p[1][1]]

        if self.options.get('lowercasenames'):
            p[0][1] = p[0][1].lower()

        if (not self.options.get('nostripvalues') and
                not hasattr(p[0][2], 'is_single_quoted') and
                not hasattr(p[0][2], 'is_double_quoted')):
            p[0][2] = p[0][2].rstrip()
207561
def update(self, statement):
        
        Statement = self.get_model('statement')
        Tag = self.get_model('tag')

        if hasattr(statement, 'id'):
            statement.save()
        else:
            statement = Statement.objects.create(
                text=statement.text,
                search_text=self.tagger.get_bigram_pair_string(statement.text),
                conversation=statement.conversation,
                in_response_to=statement.in_response_to,
                search_in_response_to=self.tagger.get_bigram_pair_string(statement.in_response_to),
                created_at=statement.created_at
            )

        for _tag in statement.tags.all():
            tag, _ = Tag.objects.get_or_create(name=_tag)

            statement.tags.add(tag)

        return statement
128859
def match_sr(self, svc_ref, cid=None):
        # type: (ServiceReference, Optional[Tuple[str, str]] ) -> bool
        
        with self.__lock:
            our_sr = self.get_reference()
            if our_sr is None:
                return False

            sr_compare = our_sr == svc_ref
            if cid is None:
                return sr_compare

            our_cid = self.get_export_container_id()
            if our_cid is None:
                return False

            return sr_compare and our_cid == cid
228907
private boolean validReturnType(final String s) {
        ReturnType rt = ReturnType.getReturnType(s);
        if (rt != null) return true;
        return false;
    }
1073546
def _update_rto(self, R):
        
        if self._srtt is None:
            self._rttvar = R / 2
            self._srtt = R
        else:
            self._rttvar = (1 - SCTP_RTO_BETA) * self._rttvar + SCTP_RTO_BETA * abs(self._srtt - R)
            self._srtt = (1 - SCTP_RTO_ALPHA) * self._srtt + SCTP_RTO_ALPHA * R
        self._rto = max(SCTP_RTO_MIN, min(self._srtt + 4 * self._rttvar, SCTP_RTO_MAX))
1000784
public void offerStatement(int stmtHash, int offset, ByteBuffer psetBuffer) {
        m_inputCRC.update(stmtHash);
        m_inputCRC.updateFromPosition(offset, psetBuffer);

        if (m_hashCount < MAX_HASHES_COUNT) {
            m_hashes[m_hashCount] = stmtHash;
            m_hashes[m_hashCount + 1] = (int) m_inputCRC.getValue();
        }
        m_hashCount += 2;
    }
336973
public void updatePB(final MiniSatStyleSolver s, int rhs) {
    switch (this.pbEncoding) {
      case SWC:
        this.swc.update(s, rhs);
        break;
      default:
        throw new IllegalStateException("Unknown pseudo-Boolean encoding: " + this.pbEncoding);
    }
  }
1351314
public void setStandard(String s)
    {
        s = s.toLowerCase();
        if (s.indexOf("allow") > -1)
        {
            standard = true;
        }
        else
        {
            standard = false;
        }
    }
320788
private void updateEqualSets(Set<AbstractExpression> values,
            HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence,
            Set< Set<AbstractExpression> > eqSets,
            AbstractExpression tveKey, AbstractExpression spExpr) {
        boolean hasLegacyValues = false;
        if (eqSets.contains(values)) {
            eqSets.remove(values);
            hasLegacyValues = true;
        }
        values.add(spExpr);
        values.add(tveKey);
        if (hasLegacyValues) {
            eqSets.add(values);
        }
        valueEquivalence.put(spExpr, values);
        valueEquivalence.put(tveKey, values);
    }
85581
function acceptParams(str, index) {
    var parts = str.split(/ *; */);
    var ret = {value: parts[0], quality: 1, params: {}, originalIndex: index};

    for (var i = 1; i < parts.length; ++i) {
        var pms = parts[i].split(/ *= */);
        if ('q' == pms[0]) {
            ret.quality = parseFloat(pms[1]);
        } else {
            ret.params[pms[0]] = pms[1];
        }
    }

    return ret;
}
9242
def mset(msg_id, values)
      values = values.inject([]){|a,(k,v)| a.concat([key(msg_id, k), v])}
      with_failover { redis.mset(*values) }
    end
1261412
def setto(self, s):
        
        length = len(s)
        self.b[self.j+1:self.j+1+length] = s
        self.k = self.j + length
944097
def accept(self, data):
        '''
        
        '''
        self.raw_data = MultiDict(data)
        self.errors = {}
        for field in self.fields:
            if field.writable:
                self.python_data.update(field.accept())
            else:
                for name in field.field_names:
                    # readonly field
                    subfield = self.get_field(name)
                    value = self.python_data[subfield.name]
                    subfield.set_raw_value(self.raw_data, subfield.from_python(value))
        return self.is_valid
441949
def _choice_stmt(self, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        self._handle_child(ChoiceNode(), stmt, sctx)
971870
public static void closeStatement(Statement st){
		if (st != null) {
			try {
				st.close();
			} catch (Exception e) {
				log.warn("Exception when closing database statement.", e);
			}
		}
	}
287148
def change_charset(s, original_charset, target_charset):
    
    if not isinstance(s, str):
        raise ValueError('"s" must be a string.')

    intermediate_integer = charset_to_int(s, original_charset)
    output_string = int_to_charset(intermediate_integer, target_charset)
    return output_string