Handler for response `SymbolInfo`.
773809
def handle_symbol_info(self, call_id, payload):
        """"""
        with catch(KeyError, lambda e: self.editor.message("unknown_symbol")):
            decl_pos = payload["declPos"]
            f = decl_pos.get("file")
            call_options = self.call_options[call_id]
            self.log.debug('handle_symbol_info: call_options %s', call_options)
            display = call_options.get("display")
            if display and f:
                self.editor.raw_message(f)

            open_definition = call_options.get("open_definition")
            if open_definition and f:
                self.editor.clean_errors()
                self.editor.doautocmd('BufLeave')
                if call_options.get("split"):
                    vert = call_options.get("vert")
                    self.editor.split_window(f, vertical=vert)
                else:
                    self.editor.edit(f)
                self.editor.doautocmd('BufReadPre', 'BufRead', 'BufEnter')
                self.set_position(decl_pos)
                del self.call_options[call_id]
238864
def handle_response(self, data):
        """"""
        identifier = data.get('id')
        self._buffer[identifier]['data'] = data.get('result')
        self._buffer[identifier]['flag'].set()
70332
def _extract_symbols(self, symbols, default=None):
        """"""
        to_ret = {}
        for symbol in symbols:
            symbolInfo = self.elf.symbol_decoder.get_symbol_for_name(symbol)
            if symbolInfo is None:
                if default is not None:
                    to_ret[symbol] = default
                    continue
                raise FlashAlgoException("Missing symbol %s" % symbol)
            to_ret[symbol] = symbolInfo.address
        return to_ret
58950
def get_options_info(self, symbol, items=None, expiration=''):
        
        response = self.select('yahoo.finance.options',items).where(['symbol','=',symbol],[] if not expiration else ['expiration','=',expiration])
        return response
175188
def error_rendering(exception, symbol)
      Rails.logger.error exception

      @exception = exception
      @symbol = symbol
      @code = Rack::Utils::SYMBOL_TO_STATUS_CODE[symbol].to_i
      respond_with @exception, status: @code, template: ERROR_PATH, prefixes: _prefixes
    end
765967
def get_symbols(self, name):
        
        url = "http://autoc.finance.yahoo.com/autoc?query={0}&callback=YAHOO.Finance.SymbolSuggest.ssCallback".format(name)

        response = requests.get(url)

        json_data = re.match("YAHOO\.Finance\.SymbolSuggest.ssCallback\((.*)\)", response.text)
        try:
            json_data = json_data.groups()[0]
        except (Exception,) as e:
            print(e)
            json_data = '{"results": "Webservice seems to be down"}'

        return type('response', (requests.Response,),{
            'text' : json_data,
            'content': json_data.encode(),
            'status_code': response.status_code,
            'reason': response.reason,
            'encoding': response.encoding,
            'apparent_encoding': response.apparent_encoding,
            'cookies': response.cookies,
            'headers': response.headers,
            'json': lambda : json.loads(json_data),
            'url': response.url
        })
452115
def _handle_inspect_reply(self, rep):
        
        cursor = self._get_cursor()
        info = self._request_info.get('call_tip')
        if info and info.id == rep['parent_header']['msg_id'] and \
          info.pos == cursor.position():
            content = rep['content']
            if content.get('status') == 'ok' and content.get('found', False):
                signature = self.get_signature(content)
                if signature:
                    # TODO: Pass the language from the Console to the calltip
                    self._control.show_calltip(signature, color='#999999',
                                               is_python=True)
863074
def id_to_symbol(self, entrez_id):
        """"""

        entrez_id = str(entrez_id)
        if entrez_id not in self.ids_to_symbols:
            m = 'Could not look up symbol for Entrez ID ' + entrez_id
            raise Exception(m)
        return self.ids_to_symbols[entrez_id]
921000
def get_online_symbol_data(database_id):
    """"""
    import pymysql
    import pymysql.cursors
    cfg = get_database_configuration()
    mysql = cfg['mysql_online']
    connection = pymysql.connect(host=mysql['host'],
                                 user=mysql['user'],
                                 passwd=mysql['passwd'],
                                 db=mysql['db'],
                                 cursorclass=pymysql.cursors.DictCursor)
    cursor = connection.cursor()
    sql = ("SELECT `id`, `formula_in_latex`, `unicode_dec`, `font`, "
           "`font_style` FROM  `wm_formula` WHERE  `id` =%i") % database_id
    cursor.execute(sql)
    datasets = cursor.fetchall()
    if len(datasets) == 1:
        return datasets[0]
    else:
        return None
314892
def handle_inform(self, msg):
        """"""
        try:
            for func in self._inform_hooks.get(msg.name, []):
                func(msg)
        except Exception:
            self._logger.warning('Call to function "{0}" with message "{1}".'
                                 .format(func, msg), exc_info=True)
        super(_InformHookDeviceClient, self).handle_inform(msg)
289785
def xinfo_help(self):
        """"""
        fut = self.execute(b'XINFO', b'HELP')
        return wait_convert(fut, lambda l: b'\n'.join(l))
513096
async function getSymbols() {
  const info = await generateInfo();
  return info.symbols.filter(symbol => symbol.kind != 'member');
}
1285509
def format_symbol(self, symbol, link_resolver):
        
        if not symbol:
            return ''

        if isinstance(symbol, FieldSymbol):
            return ''

        # pylint: disable=unused-variable
        out = self._format_symbol(symbol)
        template = self.get_template('symbol_wrapper.html')

        return template.render(
            {'symbol': symbol,
             'formatted_doc': out})
417674
def _get_scope_with_symbol(self, name):
        """"""
        scope = self
        while True:
            parent = scope.get_enclosing_scope()
            if parent is None:
                return

            if name in parent.symbols:
                return parent

            scope = parent
699146
def one_symbol_ops_str(self) -> str:
        """"""
        return re.escape(''.join((key for key in self.ops.keys() if len(key) == 1)))
380060
function SYM(symbol) {
        var _func = 'SYM("' + symbol + '")';
        return function (buffer, index, depth) {
            if (typeof depth === "undefined") { depth = 0; }
            _trace(_func, depth, true);
            var r;
            if (index + symbol.length <= buffer.length && index == buffer.indexOf(symbol, index)) {
                _trace(_func, depth, false, paka.S.OK);
                return R.ok(paka.P.SYM, index, symbol.length, null);
            } else {
                r = R.error(paka.P.SYM, index, null, 'Expects string "' + symbol + '"');
                _update_last_error(r);
                _trace(_func, depth, false, paka.S.ERROR);
                return r;
            }
        };
    }
200899
def iiif_info_handler(prefix=None, identifier=None,
                      config=None, klass=None, auth=None, **args):
    """"""
    if (not auth or degraded_request(identifier) or auth.info_authz()):
        # go ahead with request as made
        if (auth):
            logging.debug("Authorized for image %s" % identifier)
        i = IIIFHandler(prefix, identifier, config, klass, auth)
        try:
            return i.image_information_response()
        except IIIFError as e:
            return i.error_response(e)
    elif (auth.info_authn()):
        # authn but not authz -> 401
        abort(401)
    else:
        # redirect to degraded
        response = redirect(host_port_prefix(
            config.host, config.port, prefix) + '/' + identifier + '-deg/info.json')
        response.headers['Access-control-allow-origin'] = '*'
        return response