Convert text into an opcode.

    @param text: the textual opcode
    @type text: string
    @raises UnknownOpcode: the opcode is unknown
    @rtype: int
353859
def from_text(text):
    

    if text.isdigit():
        value = int(text)
        if value >= 0 and value <= 15:
            return value
    value = _by_text.get(text.upper())
    if value is None:
        raise UnknownOpcode
    return value
657051
def say(self, text):
        

        params = {
            "input": text,
            "key": self.key,
            "cs": self.cs,
            "conversation_id": self.convo_id,
            "wrapper": "CleverWrap.py"
        }

        reply = self._send(params)
        self._process_reply(reply)
        return self.output
807126
def text(self,text):
        
        if text:
            text = utfstr(text)
            text = text.strip()
            text = re.sub('\s+',' ',text)
            if text:
                self.dirty = True
                self.escpos.text(text)
676858
def encrypt_text(self, text, *args, **kwargs):
        
        b = text.encode("utf-8")
        token = self.encrypt(b, *args, **kwargs)
        return base64.b64encode(token).decode("utf-8")
480156
public String decryptText(String text)
	throws Exception
	{
		return new String(this.decrypt(toBytesFromByteText(text)), IO.CHARSET);

	}
676378
private static Object[] decodePair(String text) {
        Object[] result = new Object[2];
        int i = text.indexOf('=');
        result[0] = URLDecode(text.substring(0, i));
        result[1] = decodeObject(text.substring(i + 1));
        return result;
    }
572555
def parse(text):
        
        try:
            return int(text)
        except ValueError:
            try:
                amount = float(text)
                assert not isnan(amount) and not isinf(amount)
                return amount
            except (ValueError, AssertionError):
                return None
1333721
def setText(self, text):
        
        super(XTextEdit, self).setText(projex.text.toAscii(text))
692766
def parse(self, text):
        """"""
        if isinstance(text, bytes):
            text = text.decode("ascii")
        text = re.sub("\s+", " ", unidecode(text))
        return self.communicate(text + "\n")
814128
def op(cls,text,*args,**kwargs):
        
        return cls.fn(text,*args,**kwargs)
36909
def atoi(text: str) -> Union[int, str]:
    
    return int(text) if text.isdigit() else text
1302431
def parse(self, text):
        
        #: Do not process empty strings (Issue #3)
        if text.strip() == "":
            return ""
        #: Do not process strings consisting of a single punctuation mark (Issue #4)
        elif text.strip() in PUNCTUATION:
            _sym = text.strip()
            if _sym in tuple('.?!'):
                _tag = "."
            else:
                _tag = _sym
            if self.lemmata:
                return "{0}/{1}/O/O/{0}".format(_sym, _tag)
            else:
                return "{0}/{1}/O/O".format(_sym, _tag)
        if self.tokenize:
            _tokenized = " ".join(self.tokenizer.tokenize(text))
        else:
            _tokenized = text

        _parsed = pattern_parse(_tokenized,
                                # text is tokenized before it is passed on to
                                # pattern.de.parse
                                tokenize=False,
                                tags=self.tags, chunks=self.chunks,
                                relations=self.relations, lemmata=self.lemmata,
                                encoding=self.encoding, tagset=self.tagset)
        if self.pprint:
            _parsed = pattern_pprint(_parsed)

        return _parsed
1207803
private static Object decodeObject(String text) {
        Object result = null;
        if (text.startsWith("[]"))
            result = HexString.hexToBin(text, 2);
        else
            result = URLDecode(text);
        return result;
    }
283789
public void setText(String text) {
        span.setText(text);

        if (!span.isAttached()) {
            add(span);
        }
    }
669022
public String decode(String text) {
    if (text == null) { return null; }
    if ((!text.startsWith(Prefix)) || (!text.endsWith(Postfix)))
      throw new IllegalArgumentException("RFC 1522 violation: malformed encoded content");
    int terminator = text.length() - 2;
    int from = 2;
    int to = text.indexOf(Sep, from);
    if (to == terminator) throw new IllegalArgumentException("RFC 1522 violation: charset token not found");
    String charset = text.substring(from, to);
    if (charset.equals("")) throw new IllegalArgumentException("RFC 1522 violation: charset not specified");
    from = to + 1;
    to = text.indexOf(Sep, from);
    if (to == terminator) throw new IllegalArgumentException("RFC 1522 violation: encoding token not found");
    String encoding = text.substring(from, to);
    if (!getEncoding().equalsIgnoreCase(encoding))
      throw new IllegalArgumentException("This codec cannot decode " + encoding + " encoded content");
    from = to + 1;
    to = text.indexOf(Sep, from);
    return new String(Base64.decode(text.substring(from, to).toCharArray()), Charset.forName(charset));
  }
1333989
def inet_aton(text):
    

    #
    # Our aim here is not something fast; we just want something that works.
    #

    if text == '::':
        text = '0::'
    #
    # Get rid of the icky dot-quad syntax if we have it.
    #
    m = _v4_ending.match(text)
    if not m is None:
        text = "%s:%04x:%04x" % (m.group(1),
                                 int(m.group(2)) * 256 + int(m.group(3)),
                                 int(m.group(4)) * 256 + int(m.group(5)))
    #
    # Try to turn '::<whatever>' into ':<whatever>'; if no match try to
    # turn '<whatever>::' into '<whatever>:'
    #
    m = _colon_colon_start.match(text)
    if not m is None:
        text = text[1:]
    else:
        m = _colon_colon_end.match(text)
        if not m is None:
            text = text[:-1]
    #
    # Now canonicalize into 8 chunks of 4 hex digits each
    #
    chunks = text.split(':')
    l = len(chunks)
    if l > 8:
        raise dns.exception.SyntaxError
    seen_empty = False
    canonical = []
    for c in chunks:
        if c == '':
            if seen_empty:
                raise dns.exception.SyntaxError
            seen_empty = True
            for i in xrange(0, 8 - l + 1):
                canonical.append('0000')
        else:
            lc = len(c)
            if lc > 4:
                raise dns.exception.SyntaxError
            if lc != 4:
                c = ('0' * (4 - lc)) + c
            canonical.append(c)
    if l < 8 and not seen_empty:
        raise dns.exception.SyntaxError
    text = ''.join(canonical)

    #
    # Finally we can go to binary.
    #
    try:
        return text.decode('hex_codec')
    except TypeError:
        raise dns.exception.SyntaxError
12167
def convert_unicode(text):
	
	if isPython2:
		h = HTMLParser()
		s = h.unescape(text)
	else:
		try:
			s = unescape(text)
		except Exception:
			# Python 3.3 and below
			# https://stackoverflow.com/a/2360639/2295672
			s = HTMLParser().unescape(text)
	return s