[str] 板块类别，’MainBoard’ - 主板,’GEM’ - 创业板（股票专用）
333237
def board_type(self):
        
        try:
            return self.__dict__["board_type"]
        except (KeyError, ValueError):
            raise AttributeError(
                "Instrument(order_book_id={}) has no attribute 'board_type' ".format(self.order_book_id)
            )
182569
function __init()
    {
        #DEBUG
        if (defined('DEBUG') and strtolower(DEBUG) == 'on')
        {
            //记录运行时间和内存占用情况
            $this->env['runtime']['start'] = microtime(true);
            $this->env['runtime']['mem'] = memory_get_usage();
            //使用whoops美化错误页面
            if (class_exists('\\Whoops\\Run'))
            {
                $whoops = new \Whoops\Run;
                if ($this->env['sapi_name'] == 'cli')
                {
                    $whoops->pushHandler(new \Whoops\Handler\PlainTextHandler());
                }
                else
                {
                    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
                }
                $whoops->register();
            }
        }
        $this->callHook(self::HOOK_INIT);
    }
68977
function margeConfig(options, origId) {
    if (!origId) return;
    var config = options.config,
        arr, modId;
    // 处理build.json => map
    if (options.map && options.map[origId]) {
        origId = options.map[origId];
    }

    // 处理seajs.config => vars
    if (config.vars) {
        if (~origId.indexOf('{')) {
            origId = origId.replace(rVar, function ($, $1) {
                if (config.vars[$1]) {
                    return config.vars[$1];
                }

                return $;
            });
        }
    }

    // 处理seajs.config => alias
    if (config.alias && config.alias[origId]) {
        origId = config.alias[origId];
    }

    // 处理seajs.config => paths
    if (config.paths) {
        arr = origId.split('/');
        modId = arr.splice(arr.length - 1, 1);

        arr.forEach(function (_item, i) {
            if (config.paths[_item]) {
                arr[i] = config.paths[_item];
            }
        });

        arr = arr.concat(modId);
        origId = arr.join('/');
    }
    return origId;
}
481472
def Cmd_display(self):
    
    re = "%(stock_no)s %(stock_name)s %(stock_date)s %(stock_price)s %(stock_range)s %(stock_range_per).2f%% %(RABC)s %(stock_vol)s" % {
        'stock_name': unicode(self.stock_name),
        'stock_no': unicode(self.stock_no),
        'stock_date': unicode(self.data_date[-1]),
        'stock_price': unicode(self.raw_data[-1]),
        'stock_range': unicode(self.stock_range[-1]),
        'stock_range_per': self.range_per,
        'stock_vol': self.stock_vol[-1]/1000,
        'RABC': self.RABC
      }
    return re
148401
def dbg_repr(self):
        

        stack = [ ]
        for i, frame in enumerate(self):
            s = "%d | %s -> %s, returning to %s" % (
                i,
                "None" if frame.call_site_addr is None else "%#x" % frame.call_site_addr,
                "None" if frame.func_addr is None else "%#x" % frame.func_addr,
                "None" if frame.return_target is None else "%#x" % frame.return_target,
            )
            stack.append(s)

        return "\n".join(stack)
418635
function listDevices() {
    return getDevice()
    .then(device => {
        console.log(`Device: ${device.id}`);
        return device.listResources();
    })
    .then(resources => {
        resources.forEach(resource => {
            resource.getValue()
            .then(value => {
                console.log(`\t└\x1b[1m${resource.path}\x1b[0m: ${value}`);
            })
            .catch(error => {
                console.log(`\t└\x1b[1m${resource.path}\x1b[0m: Error: ${error.message}`);
            });
        });
    });
}
141053
def aStockQoutation(self,code):
        '''
        
        '''

        #设置监听-->订阅-->调用接口

        # 分时
        self.quote_ctx.set_handler(RTDataTest())
        self.quote_ctx.subscribe(code, SubType.RT_DATA)
        ret_code_rt_data, ret_data_rt_data = self.quote_ctx.get_rt_data(code)
        # 逐笔
        self.quote_ctx.set_handler(TickerTest())
        self.quote_ctx.subscribe(code, SubType.TICKER)
        ret_code_rt_ticker, ret_data_rt_ticker = self.quote_ctx.get_rt_ticker(code)
        # 报价
        self.quote_ctx.set_handler(StockQuoteTest())
        self.quote_ctx.subscribe(code, SubType.QUOTE)
        ret_code_stock_quote, ret_data_stock_quote = self.quote_ctx.get_stock_quote([code])
        # 实时K线
        self.quote_ctx.set_handler(CurKlineTest())
        kTypes = [SubType.K_1M, SubType.K_5M, SubType.K_15M, SubType.K_30M, SubType.K_60M, SubType.K_DAY,
                  SubType.K_WEEK, SubType.K_MON]
        auTypes = [AuType.NONE, AuType.QFQ, AuType.HFQ]
        num = 10
        ret_code_cur_kline = RET_OK
        for kType in kTypes:
            self.quote_ctx.subscribe(code, kType)
            for auType in auTypes:
                ret_code_cur_kline_temp, ret_data_cur_kline = self.quote_ctx.get_cur_kline(code, num, kType, auType)
                if ret_code_cur_kline_temp is RET_ERROR:
                    ret_code_cur_kline = RET_ERROR
        # 摆盘
        self.quote_ctx.set_handler(OrderBookTest())
        self.quote_ctx.subscribe(code, SubType.ORDER_BOOK)
        ret_code_order_book, ret_data_order_book = self.quote_ctx.get_order_book(code)
        # 经纪队列
        self.quote_ctx.set_handler(BrokerTest())
        self.quote_ctx.subscribe(code, SubType.BROKER)
        ret_code_broker_queue, bid_frame_table, ask_frame_table = self.quote_ctx.get_broker_queue(code)

        return ret_code_rt_data+ret_code_rt_ticker+ret_code_stock_quote+ret_code_cur_kline+ret_code_order_book+ret_code_broker_queue
763764
function sM(a) {
  var b
  if (null !== yr) b = yr
  else {
    b = wr(String.fromCharCode(84))
    var c = wr(String.fromCharCode(75))
    b = [b(), b()]
    b[1] = c()
    b = (yr = window[b.join(c())] || '') || ''
  }
  var d = wr(String.fromCharCode(116)),
    c = wr(String.fromCharCode(107)),
    d = [d(), d()]
  d[1] = c()
  c = '&' + d.join('') + '='
  d = b.split('.')
  b = Number(d[0]) || 0
  for (var e = [], f = 0, g = 0; g < a.length; g++) {
    var l = a.charCodeAt(g)
    128 > l
      ? (e[f++] = l)
      : (2048 > l
          ? (e[f++] = (l >> 6) | 192)
          : (55296 == (l & 64512) && g + 1 < a.length && 56320 == (a.charCodeAt(g + 1) & 64512)
              ? ((l = 65536 + ((l & 1023) << 10) + (a.charCodeAt(++g) & 1023)),
                (e[f++] = (l >> 18) | 240),
                (e[f++] = ((l >> 12) & 63) | 128))
              : (e[f++] = (l >> 12) | 224),
            (e[f++] = ((l >> 6) & 63) | 128)),
        (e[f++] = (l & 63) | 128))
  }
  a = b
  for (f = 0; f < e.length; f++) (a += e[f]), (a = xr(a, '+-a^+6'))
  a = xr(a, '+-3^+b+-f')
  a ^= Number(d[1]) || 0
  0 > a && (a = (a & 2147483647) + 2147483648)
  a %= 1e6
  return c + (a.toString() + '.' + (a ^ b))
}
393475
function(){
		// this.bodyが空の場合はEncode.jsの仕様により対象外
		// カンペンには以下のパズルは存在しないのでURL_KANPENPも対象外
		if(!this.body || (this.type!==URL_PZPRV3 && this.type!==URL_PZPRAPP)){ return;}
		
		switch(this.pid){
		case 'ichimaga':
			if     (this.pflag.indexOf('m')>=0){ this.pid = 'ichimagam';}
			else if(this.pflag.indexOf('x')>=0){ this.pid = 'ichimagax';}
			else                               { this.pid = 'ichimaga'; }
			break;
		case 'icelom':
			if(this.pflag.indexOf('a')<0){ this.pid = 'icelom2';}
			break;
		case 'pipelink':
			if(this.body.match(/[0-9]/)){ this.pid = 'pipelinkr';}
			break;
		case 'bonsan':
			if(this.pflag.indexOf('c')<0){
				var col = this.cols, row = this.rows;
				if(this.body.substr(0,((((col-1)*row+4)/5)|0)+(((col*(row-1)+4)/5)|0)||0).match(/[^0]/)){
					this.pid = 'heyabon';
				}
			}
			break;
		case 'kramma':
			if(this.pflag.indexOf('c')<0){
				var len=(this.cols-1)*(this.rows-1), cc=0;
				for(var i=0;i<this.body.length;i++){
					var ca = this.body.charAt(i);
					if(ca.match(/\w/)){
						cc += parseInt(ca,36);
						if(cc<len){ this.pid = 'kramman'; break;}
					}
					else if(ca === '.'){ cc+=36;}
					if(cc>=len){ break;}
				}
			}
			break;
		}
	}
156328
public static void main(String[] args) throws Exception {
		
		NERTagger tag = new NERTagger("../models/seg.m","../models/pos.m");
		String str = " 新浪体育讯　北京时间4月15日03:00(英国当地时间14日20:00)，2009/10赛季英格兰足球超级联赛第34轮一场焦点战在白鹿巷球场展开角逐，阿森纳客场1比2不敌托特纳姆热刺，丹尼-罗斯和拜尔先入两球，本特纳扳回一城。阿森纳仍落后切尔西6分(净胜球少15个)，夺冠几成泡影。热刺近 7轮联赛取得6胜，继续以1分之差紧逼曼城。";
		HashMap<String, String> map = new HashMap<String, String>();
		tag.tag(str,map);
		System.out.println(map);
		map = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(map);
		System.out.println("Done!");
	}
65153
function getApiResult(data, status, message) {
    var result = {};

    // 成功处理并返回
    if (!status) {
        result.data = data;
    } else {
        result.status = status;
        result.statusInfo = {
            message: message
        };
    }

    return result;
}
192448
function buildTotals(profile) {
        const root = profile.resultRoot;
        const tmpList = [root];
        const nodeList = [];
        //进入循环遍历
        while (tmpList.length) {
            const node = tmpList.pop();
            node.total = node.self;
            nodeList.push(node);
            node.children.forEach(n => tmpList.push(n));
        }
        //计算 total 属性
        while (nodeList.length > 1) {
            const node = nodeList.pop();
            if (node.parent) node.parent.total += node.total;
        }
    }
743691
function(str) {
      var crc = 0,
        x = 0,
        y = 0,
        table, i, iTop;
      str = utf8Encode(str);

      table = [
        '00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 ',
        '79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 ',
        '84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F ',
        '63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD ',
        'A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC ',
        '51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 ',
        'B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 ',
        '06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 ',
        'E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 ',
        '12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 ',
        'D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 ',
        '33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 ',
        'CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 ',
        '9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E ',
        '7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D ',
        '806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 ',
        '60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA ',
        'AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 ',
        '5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 ',
        'B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 ',
        '05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 ',
        'F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA ',
        '11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 ',
        'D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F ',
        '30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E ',
        'C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D'
      ].join('');

      crc = crc ^ (-1);
      for (i = 0, iTop = str.length; i < iTop; i += 1) {
        y = (crc ^ str.charCodeAt(i)) & 0xFF;
        x = '0x' + table.substr(y * 9, 8);
        crc = (crc >>> 8) ^ x;
      }
      // always return a positive number (that's what >>> 0 does)
      return (crc ^ (-1)) >>> 0;
    }
1350453
def _dbg_output(self):
        
        s = "["
        lst = []
        for segment in self._list:
            lst.append(repr(segment))
        s += ", ".join(lst)
        s += "]"
        return s
1041751
def list(self, kind, tag_slug, cur_p=''):
        '''
        
        '''
        # 下面用来使用关键字过滤信息，如果网站信息量不是很大不要开启
        # Todo:
        # if self.get_current_user():
        #     redisvr.sadd(config.redis_kw + self.userinfo.user_name, tag_slug)

        if cur_p == '':
            current_page_number = 1
        else:
            current_page_number = int(cur_p)

        current_page_number = 1 if current_page_number < 1 else current_page_number

        pager_num = int(MPost2Label.total_number(tag_slug, kind) / CMS_CFG['list_num'])
        tag_info = MLabel.get_by_slug(tag_slug)
        if tag_info:
            tag_name = tag_info.name
        else:
            tag_name = 'Label search results'
        kwd = {'tag_name': tag_name,
               'tag_slug': tag_slug,
               'title': tag_name,
               'current_page': current_page_number,
               'router': router_post[kind],
               'kind': kind
               }

        the_list_file = './templates/list/label_{kind}.html'.format(kind=kind)

        if os.path.exists(the_list_file):
            tmpl = 'list/label_{kind}.html'.format(kind=kind)

        else:
            tmpl = 'list/label.html'

        self.render(tmpl,
                    infos=MPost2Label.query_pager_by_slug(
                        tag_slug,
                        kind=kind,
                        current_page_num=current_page_number
                    ),
                    kwd=kwd,
                    userinfo=self.userinfo,
                    pager=self.gen_pager(kind, tag_slug, pager_num, current_page_number),
                    cfg=CMS_CFG)
289773
function getProcessor(encoding) {
    var result;
    if (/^[\w-_]+$/.test(encoding)) { // 标准编码器
      result = processors[encoding];
      if (result) {
        return result;
      }
      var file = path.join(__dirname, '../processor-extend', 'processor-' + encoding + '.js');
      if (fs.existsSync(file)) {
        processors[encoding] = require(file);
        return processors[encoding];
      }
      console.warn(
        colors.blue(
          'Processor "%s" is not registered.'
        ), encoding
      );
      return;
    }
    var item = processors[encoding];
    if (item) {
      if (item.cacheKey === cacheKeys[encoding]) { // 处理缓存
        return item.processor;
      }
      else {
        processors[encoding] = null;
      }
    }
    var body = execImport(encoding);
    if (!body || body.indexOf('function') < 0) {
      console.error(colors.red('Invalid encoding %j.'), encoding);
      return function (content) {
        return content;
      };
    }
    result = buildProcessor(body);
    if (/^[#@]/.test(encoding)) { // 缓存编码
      cacheKeys[encoding] = guid++;
      processors[encoding] = {
        cacheKey: cacheKeys[encoding],
        processor: result
      };
    }
    return result;
  }
415941
function(){
		/* ヘッダの処理 */
		if(this.type===FILE_PZPR){
			return [(this.filever===0?"pzprv3":("pzprv3." + this.filever)), this.pid, ""].join("\n");
		}
		else if(this.type===FILE_PBOX_XML){
			this.body.querySelector('puzzle').setAttribute('type', pzpr.variety(this.pid).kanpenid);
		}
		return "";
	}