Call from on the text and return a Naf object
179897
def corenlp2naf(xml_bytes, annotators):
    
    naf = KafNafParser(type="NAF")

    try:
        doc = Document(xml_bytes)
    except:
        log.exception("Error on parsing xml")
        raise

    terms = {} # (xml_sentid, xml_tokenid) : term
    for sent in doc.sentences:
        for t in sent.tokens:
            wf = naf.create_wf(t.word, sent.id, t.character_offset_begin)
            term = naf.create_term(t.lemma, POSMAP[t.pos], t.pos, [wf])
            terms[sent.id, t.id] = term
            if t.ner not in (None, 'O'):
                naf.create_entity(t.ner, [term.get_id()])
        if sent.collapsed_ccprocessed_dependencies:
            dependencies = True
            for dep in sent.collapsed_ccprocessed_dependencies.links:
                if dep.type != 'root':
                    child = terms[sent.id, dep.dependent.idx]
                    parent = terms[sent.id, dep.governor.idx]
                    comment = "{t}({o}, {s})".format(s=child.get_lemma(), t=dep.type, o=parent.get_lemma())
                    naf.create_dependency(child.get_id(), parent.get_id(), dep.type, comment=comment)

    if doc.coreferences:
        for coref in doc.coreferences:
            cterms = set()
            for m in coref.mentions:
                cterms |= {terms[m.sentence.id, t.id].get_id() for t in m.tokens}
            naf.create_coreference("term", cterms)
        
    for annotator in annotators:
        if annotator in LAYERMAP:
            naf.create_linguistic_processor(LAYERMAP[annotator], "CoreNLP {annotator}".format(**locals()),
                                            get_corenlp_version())
    s = BytesIO()
    naf.dump(s)
    return s.getvalue()
75427
function TextInput( options = {} ) {
	Element.call( this , options ) ;

	// TextBufffer needs computed attr, not object one
	this.textAttr = options.textAttr || { bgColor: 'blue' } ;
	this.emptyAttr = options.emptyAttr || { bgColor: 'blue' } ;

	this.hidden = options.hidden ;

	this.labelFocusAttr = options.labelFocusAttr || { bold: true } ;
	this.labelBlurAttr = options.labelBlurAttr || { dim: true } ;

	if ( options.keyBindings ) { this.keyBindings = options.keyBindings ; }

	if ( options.editableTextBoxKeyBindings ) { this.editableTextBoxKeyBindings = options.editableTextBoxKeyBindings ; }
	else if ( options.allowNewLine ) { this.editableTextBoxKeyBindings = this.multiLineEditableTextBoxKeyBindings ; }

	if ( this.label ) {
		this.labelText = new Text( {
			parent: this ,
			content: this.label ,
			x: this.outputX ,
			y: this.outputY ,
			height: 1 ,
			attr: this.labelBlurAttr ,
			leftPadding: this.labelBlurLeftPadding ,
			rightPadding: this.labelBlurRightPadding ,
			noDraw: true
		} ) ;
	}

	this.editableTextBox = new EditableTextBox( {
		parent: this ,
		content: this.value || this.content ,
		x: this.outputX + ( this.labelText ? this.labelText.outputWidth : 0 ) ,
		y: this.outputY ,
		width: this.outputWidth - ( this.labelText ? this.labelText.outputWidth : 0 ) ,
		height: this.outputHeight ,
		hidden: this.hidden ,
		textAttr: this.textAttr ,
		emptyAttr: this.emptyAttr ,
		keyBindings: this.editableTextBoxKeyBindings ,
		noDraw: true
	} ) ;

	this.updateStatus() ;

	this.onKey = this.onKey.bind( this ) ;
	this.onFocus = this.onFocus.bind( this ) ;
	this.onClick = this.onClick.bind( this ) ;

	this.on( 'key' , this.onKey ) ;
	this.on( 'focus' , this.onFocus ) ;
	this.on( 'click' , this.onClick ) ;

	// Only draw if we are not a superclass of the object
	if ( this.elementType === 'TextInput' && ! options.noDraw ) { this.draw() ; }
}
55449
def text_to_data(self, text, elt, ps):
        '''
        '''
        val = b64decode(text.replace(' ', '').replace('\n','').replace('\r',''))
        if self.pyclass is not None:
            return self.pyclass(val)
        return val
513383
def from_text(cls, text: str):
        

        eidosProcessor = process_text(text)
        return cls.from_statements(eidosProcessor.statements)
785310
def _call(self, x):
        """"""
        y = np.bincount(self._indices_flat, weights=x,
                        minlength=self.range.size)

        out = y.reshape(self.range.shape)

        if self.variant == 'dirac':
            weights = getattr(self.range, 'cell_volume', 1.0)
        elif self.variant == 'char_fun':
            weights = 1.0
        else:
            raise RuntimeError('The variant "{!r}" is not yet supported'
                               ''.format(self.variant))

        if weights != 1.0:
            out /= weights

        return out
224123
def _call(self, x):
        """"""
        result = self.sess.run(self.output_tensor,
                               feed_dict={self.input_tensor: np.asarray(x)})

        return result
1093512
def call(self, name, *args, **kwargs):
        """"""
        return self.request('nvim_call_function', name, args, **kwargs)
493106
def text_to_vector(sent_str):
    """"""
    r = requests.get("{}/sva/vector".format(VECTORIZE_API), params={'s':sent_str})
    return inflate(r.text)
244339
def call_cur(f):
  ""
  @functools.wraps(f)
  def f2(self, *args, **kwargs):
    with self.withcur() as cur:
      return f(self, cur, *args, **kwargs)
  return f2
921855
function withLineNumbers(text, offset, offendingLine) {
    if (typeof offendingLine !== 'number') {
      offendingLine = NaN;
    }

    var lines = text;
    if (typeof lines === 'string') {
      lines = lines.split('\n');
    }

    return lines.map(function(line, i) {
      line = (i + offset) + ': ' + line;
      if (i === (offendingLine - 1)) {
        line = '\x1B[31m' + line + '\x1B[39m';
      } else {
        line = '\x1B[90m' + line + '\x1B[39m';
      }
      return line;
    }).join('\n');
  }
898494
def text_to_data(self, text, elt, ps):
        '''
        '''
        prefix,localName = SplitQName(text)
        nsdict = ps.GetElementNSdict(elt)
        prefix = prefix or ''
        try:
            namespaceURI = nsdict[prefix]
        except KeyError, ex:
            raise EvaluateException('cannot resolve prefix(%s)'%prefix,
                ps.Backtrace(elt))
                
        v = (namespaceURI,localName)
        if self.pyclass is not None:
            return self.pyclass(v)    
        return v
668845
def call_parse(func):
    ""
    name = inspect.currentframe().f_back.f_globals['__name__']
    if name == "__main__":
        args = anno_parser(func).parse_args()
        func(**args.__dict__)
    else: return func
462611
def call(function, args, pseudo_type=None):
    ''''''

    if not isinstance(function, Node):
        function = local(function)
    return Node('call', function=function, args=args, pseudo_type=pseudo_type)
349218
def text_to_data(self, text, elt, ps):
        '''
        '''
        if self.pyclass is not None:
            v = self.pyclass(text) 
        else:
            try:
                v = int(text)
            except:
                try:
                    v = long(text)
                except:
                    raise EvaluateException('Unparseable integer', 
                        ps.Backtrace(elt))
        return v
968230
def _callFunc(session, funcName, password, args):
    """"""

    txid = _randomString()
    sock = session.socket
    sock.send(bytearray('d1:q6:cookie4:txid10:%se' % txid, 'utf-8'))
    msg = _getMessage(session, txid)
    cookie = msg['cookie']
    txid = _randomString()
    tohash = (password + cookie).encode('utf-8')
    req = {
        'q': funcName,
        'hash': hashlib.sha256(tohash).hexdigest(),
        'cookie': cookie,
        'args': args,
        'txid': txid
    }

    if password:
        req['aq'] = req['q']
        req['q'] = 'auth'
        reqBenc = bencode(req).encode('utf-8')
        req['hash'] = hashlib.sha256(reqBenc).hexdigest()

    reqBenc = bencode(req)
    sock.send(bytearray(reqBenc, 'utf-8'))
    return _getMessage(session, txid)
41941
def call_frog(text):
    
    
    host, port = os.environ.get('FROG_HOST', 'localhost:9887').split(":")
    frogclient = FrogClient(host, port, returnall=True)
    sent = 1
    offset = 0
    for word, lemma, morph, morphofeat, ner, chunk, _p1, _p2 in frogclient.process(text):
        if word is None:
            sent += 1
        else:
            pos = _POSMAP[morphofeat.split("(")[0]]
            yield Token(sent, offset, word, lemma, pos, morphofeat, ner, chunk)
            offset += len(word)
1124464
def append_to_run_from_text(cls, r, text):
        
        appender = cls(r)
        appender.add_text(text)