Removes the statement that matches the input text.
        Removes any responses from statements where the response text matches
        the input text.
492651
def remove(self, statement_text):
        
        Statement = self.get_model('statement')
        session = self.Session()

        query = session.query(Statement).filter_by(text=statement_text)
        record = query.first()

        session.delete(record)

        self._session_finish(session)
941790
private void destroyStatement(Object unwantedStatement) {
        try {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, 
                         "Statement cache at capacity. Discarding a statement.",
                         AdapterUtil.toString(unwantedStatement));

            ((Statement) unwantedStatement).close();
        } catch (SQLException closeX) {
            FFDCFilter.processException(
                                        closeX, getClass().getName() + ".discardStatement", "511", this);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "Error closing statement", AdapterUtil.toString(unwantedStatement), closeX);
        }
    }
441744
@Override
    public ItemStream removeFirstMatching(Filter filter, Transaction transaction) throws MessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeFirstMatching", new Object[] { filter, transaction });

        if (_rootMembership != null)
        {
            ItemStream item = _rootMembership.removeFirstMatchingItemStream(filter, (PersistentTransaction) transaction);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "removeFirstMatching", "return=" + item);
            return item;
        }
        else
        {
            MessageStoreUnavailableException msue;
            if (!_startupExceptions.isEmpty())
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Operation not possible as MessageStore failed to start!");
                msue = new MessageStoreUnavailableException("Operation not possible as MessageStore failed to start!", _startupExceptions.get(0));
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Operation not possible as MessageStore is unavailable!");
                msue = new MessageStoreUnavailableException("Operation not possible as MessageStore is unavailable!");
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "removeFirstMatching");
            throw msue;
        }
    }
262529
public void removeReading(AnalyzedToken token) {
    List<AnalyzedToken> l = new ArrayList<>();
    AnalyzedToken tmpTok = new AnalyzedToken(token.getToken(), token.getPOSTag(), token.getLemma());
    tmpTok.setWhitespaceBefore(isWhitespaceBefore);
    boolean removedSentEnd = false;
    boolean removedParaEnd = false;
    for (AnalyzedToken anTokReading : anTokReadings) {
      if (!anTokReading.matches(tmpTok)) {
        l.add(anTokReading);
      } else if (SENTENCE_END_TAGNAME.equals(anTokReading.getPOSTag())) {
        removedSentEnd = true;
      } else if (PARAGRAPH_END_TAGNAME.equals(anTokReading.getPOSTag())) {
        removedParaEnd = true;
      }
    }
    if (l.isEmpty()) {
      l.add(new AnalyzedToken(this.token, null, null));
      l.get(0).setWhitespaceBefore(isWhitespaceBefore);
    }
    anTokReadings = l.toArray(new AnalyzedToken[0]);
    setNoRealPOStag();
    if (removedSentEnd) {
      isSentEnd = false;
      setSentEnd();
    }
    if (removedParaEnd) {
      isParaEnd = false;
      setParagraphEnd();
    }
    hasSameLemmas = areLemmasSame();
  }
445562
protected function cleanResponse()
    {
        // If the option to strip bad characters is not set, then we shouldn't
        // do anything here.
        if (!$this->options['strip_bad_chars']) {
            return;
        }

        // Strip invalid characters from the XML response body.
        $count = 0;
        $this->__last_response = preg_replace(
            '/(?!&#x0?(9|A|D))(&#x[0-1]?[0-9A-F];)/',
            ' ',
            $this->__last_response,
            -1,
            $count
        );

        // If the option to warn on bad characters is set, and some characters
        // were stripped, then trigger a warning.
        if ($this->options['warn_on_bad_chars'] && $count > 0) {
            trigger_error(
                'Invalid characters were stripped from the XML SOAP response.',
                E_USER_WARNING
            );
        }
    }
131201
protected static Map<String, List<Statement>> removeStatements(Set<String> statementIds, Map<String, List<Statement>> claims) {
		Map<String, List<Statement>> newClaims = new HashMap<>(claims.size());
		for(Entry<String, List<Statement>> entry : claims.entrySet()) {
			List<Statement> filteredStatements = new ArrayList<>();
			for(Statement s : entry.getValue()) {
				if(!statementIds.contains(s.getStatementId())) {
					filteredStatements.add(s);
				}
			}
			if(!filteredStatements.isEmpty()) {
				newClaims.put(entry.getKey(),
					filteredStatements);
			}
		}
		return newClaims;
	}
604189
def filter(self, **kwargs):
        
        from django.db.models import Q

        Statement = self.get_model('statement')

        kwargs.pop('page_size', 1000)
        order_by = kwargs.pop('order_by', None)
        tags = kwargs.pop('tags', [])
        exclude_text = kwargs.pop('exclude_text', None)
        exclude_text_words = kwargs.pop('exclude_text_words', [])
        persona_not_startswith = kwargs.pop('persona_not_startswith', None)
        search_text_contains = kwargs.pop('search_text_contains', None)

        # Convert a single sting into a list if only one tag is provided
        if type(tags) == str:
            tags = [tags]

        if tags:
            kwargs['tags__name__in'] = tags

        statements = Statement.objects.filter(**kwargs)

        if exclude_text:
            statements = statements.exclude(
                text__in=exclude_text
            )

        if exclude_text_words:
            or_query = [
                ~Q(text__icontains=word) for word in exclude_text_words
            ]

            statements = statements.filter(
                *or_query
            )

        if persona_not_startswith:
            statements = statements.exclude(
                persona__startswith='bot:'
            )

        if search_text_contains:
            or_query = Q()

            for word in search_text_contains.split(' '):
                or_query |= Q(search_text__contains=word)

            statements = statements.filter(
                or_query
            )

        if order_by:
            statements = statements.order_by(*order_by)

        for statement in statements.iterator():
            yield statement
181866
public synchronized void remove(final int statementId) {
        MySQLBinaryStatement binaryStatement = getBinaryStatement(statementId);
        if (null != binaryStatement) {
            statementIdAssigner.remove(binaryStatement.getSql());
            binaryStatements.remove(statementId);
        }
    }
672191
def _clean_result(self, text):
        """"""
        text = re.sub('\s\s+', ' ', text)
        text = re.sub('\.\.+', '.', text)
        text = text.replace("'", "\\'")
        return text
463882
public void removeMatch(String name, PseudoClassType pseudoClass)
    {
        if (names != null)
        {
            Set<PseudoClassType> classes = names.get(name);
            if (classes != null)
                classes.remove(pseudoClass);
        }   
    }
1128587
@Override
    public final void clearReplyFields() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "clearReplyFields");
        getApi().setChoiceField(JsApiAccess.REPLYDISCRIMINATOR, JsApiAccess.IS_REPLYDISCRIMINATOR_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYPRIORITY, JsApiAccess.IS_REPLYPRIORITY_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYRELIABILITY, JsApiAccess.IS_REPLYRELIABILITY_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYTIMETOLIVE, JsApiAccess.IS_REPLYTIMETOLIVE_UNSET);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "clearReplyFields");
    }
719722
public void deleteSelectedText()
	{
		if (!selectingText)
			return;

		int start = Math.min(selectionCursor.index, cursor.index);
		int end = Math.max(selectionCursor.index, cursor.index);

		String oldValue = this.text.toString();
		String newValue = new StringBuilder(oldValue).delete(start, end).toString();

		if (!fireEvent(new ComponentEvent.ValueChange<>(this, oldValue, newValue)))
			return;

		this.text = new StringBuilder(newValue);
		guiText.setText(newValue);
		selectingText = false;
		cursor.jumpTo(start);
	}
625513
private void pruneMatches() {
		int index = 0;
		while( index < matches.size ) {
			AssociatedTripleIndex a = matches.get(index);
			// not matched. Remove it from the list by copying that last element over it
			if( a.c == -1 ) {
				a.set(matches.get(matches.size-1));
				matches.size--;
			} else {
				index++;
			}
		}
	}
506945
protected String removeInvalidHeaderCommentsAndProcessVelocityMacros(String text) {
        String answer = "";
        String[] lines = text.split("\r?\n");
        for (String line : lines) {
            String l = line.trim();
            // a bit of Velocity here
            if (!l.startsWith("##") && !l.startsWith("#set(")) {
                if (line.contains("${D}")) {
                    line = line.replaceAll("\\$\\{D\\}", "\\$");
                }
                answer = answer.concat(line);
                answer = answer.concat(System.lineSeparator());
            }
        }
        return answer;
    }
391971
def remove_comments(text):
    
    def _replacer(match):
        # if the 2nd group (capturing comments) is not None,
        # it means we have captured a non-quoted (real) comment string.
        if match.group(2) is not None:
            return ""  # so we will return empty to remove the comment
        else:  # otherwise, we will return the 1st group
            return match.group(1)  # captured quoted-string

    return COMMENT_PATTERN.sub(_replacer, text)
743347
def cleanBlockQuotedText(text, joiner=b' '):
    """"""
    L = filter(truth, map(_lineClean, split(text, '\n')))
    return joiner.join(L)
14333
protected String removeQuotes( String text ) {
        assert text != null;
        if (text.length() > 2) {
            char first = text.charAt(0);
            // Need to remove these only if they are paired ...
            if (first == '"' || first == '\'') {
                int indexOfLast = text.length() - 1;
                char last = text.charAt(indexOfLast);
                if (last == first) {
                    text = text.substring(1, indexOfLast);
                }
            }
        }
        return text;
    }