从数据库中查询fsid的信息.
        
        如果存在的话, 就返回这条记录;
        如果没有的话, 就返回None
165484
def get_task_db(self, fs_id):
        '''
        '''
        sql = 'SELECT * FROM tasks WHERE fsid=?'
        req = self.cursor.execute(sql, [fs_id, ])
        if req:
            return req.fetchone()
        else:
            None
878247
def _fssys(name, value=None, log_lvl=None, log_msg=None):
    '''
    
    '''
    fspath = _fspath()
    if not fspath:
        return False
    else:
        return _sysfs_attr([fspath, name], value, log_lvl, log_msg)
177540
def _get_fix_info(fbfid):
        """"""
        fix_info = FbMem.FixScreenInfo()
        fcntl.ioctl(fbfid, FbMem.FBIOGET_FSCREENINFO, fix_info)
        return fix_info
1087769
def _vcf_info(start, end, mate_id, info=None):
    
    out = "SVTYPE=BND;MATEID={mate};IMPRECISE;CIPOS=0,{size}".format(
        mate=mate_id, size=end-start)
    if info is not None:
        extra_info = ";".join("{0}={1}".format(k, v) for k, v in info.iteritems())
        out = "{0};{1}".format(out, extra_info)
    return out
1367268
def QA_data_stock_to_fq(__data, type_='01'):

    def __QA_fetch_stock_xdxr(
            code,
            format_='pd',
            collections=DATABASE.stock_xdxr
    ):
        '获取股票除权信息/数据库'
        try:
            data = pd.DataFrame(
                [item for item in collections.find({'code': code})]
            ).drop(['_id'],
                   axis=1)
            data['date'] = pd.to_datetime(data['date'])
            return data.set_index(['date', 'code'], drop=False)
        except:
            return pd.DataFrame(
                data=[],
                columns=[
                    'category',
                    'category_meaning',
                    'code',
                    'date',
                    'fenhong',
                    'fenshu',
                    'liquidity_after',
                    'liquidity_before',
                    'name',
                    'peigu',
                    'peigujia',
                    'shares_after',
                    'shares_before',
                    'songzhuangu',
                    'suogu',
                    'xingquanjia'
                ]
            )

    ''

    code = __data.index.remove_unused_levels().levels[1][0] if isinstance(
        __data.index,
        pd.core.indexes.multi.MultiIndex
    ) else __data['code'][0]

    return _QA_data_stock_to_fq(
        bfq_data=__data,
        xdxr_data=__QA_fetch_stock_xdxr(code),
        fqtype=type_
    )
634093
public synchronized long nextId() {
		long timestamp = genTime();
		if (timestamp < lastTimestamp) {
			// 如果服务器时间有问题(时钟后退) 报错。
			throw new IllegalStateException(StrUtil.format("Clock moved backwards. Refusing to generate id for {}ms", lastTimestamp - timestamp));
		}
		if (lastTimestamp == timestamp) {
			sequence = (sequence + 1) & sequenceMask;
			if (sequence == 0) {
				timestamp = tilNextMillis(lastTimestamp);
			}
		} else {
			sequence = 0L;
		}

		lastTimestamp = timestamp;

		return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence;
	}
1306640
def getflags(fd):
    

    flags_ptr = ffi.new('uint64_t*')
    flags_buf = ffi.buffer(flags_ptr)
    fcntl.ioctl(fd, lib.FS_IOC_GETFLAGS, flags_buf)
    return flags_ptr[0]
768570
def get_sid_info(self,j):
        ''''''
        h = self.gdx_handle
        r, name, dims, stype = gdxcc.gdxSymbolInfo(h, j)
        assert r, '%d is not a valid symbol number' % j
        r, records, userinfo, description = gdxcc.gdxSymbolInfoX(h, j)
        assert r, '%d is not a valid symbol number' % j
        return {'name':name, 'stype':stype, 'desc':description, 'dim':dims}
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
815709
function guid() {
    let curr = (new Date()).valueOf().toString();
    return [
        '4b534c46',  // Fixed first group. and a trick
        rand16Num(4),
        '4' + rand16Num(3),  // The first character of 3rd group is '4'.
        rand16Num(4),
        curr.substring(0, 12)
    ].join('-');
}
737673
function require( requireId, callback ) {
        // #begin-ignore
        // #begin assertNotContainRelativeId
        // 确定require的模块id不包含相对id。用于global require，提前预防难以跟踪的错误出现
        var invalidIds = [];

        /**
         * 监测模块id是否relative id
         *
         * @inner
         * @param {string} id 模块id
         */
        function monitor( id ) {
            if ( id.indexOf( '.' ) === 0 ) {
                invalidIds.push( id );
            }
        }

        if ( typeof requireId === 'string' ) {
            monitor( requireId );
        }
        else {
            each(
                requireId,
                function ( id ) {
                    monitor( id );
                }
            );
        }

        // 包含相对id时，直接抛出错误
        if ( invalidIds.length > 0 ) {
            throw new Error(
                '[REQUIRE_FATAL]Relative ID is not allowed in global require: '
                + invalidIds.join( ', ' )
            );
        }
        // #end assertNotContainRelativeId

        // 超时提醒
        var timeout = requireConf.waitSeconds;
        if ( timeout && (requireId instanceof Array) ) {
            if ( waitTimeout ) {
                clearTimeout( waitTimeout );
            }
            waitTimeout = setTimeout( waitTimeoutNotice, timeout * 1000 );
        }
        // #end-ignore

        return actualGlobalRequire( requireId, callback );
    }
958411
function sizeof(ttf) {
            ttf.support.glyf = [];
            var tableSize = 0;
            var hinting = ttf.writeOptions ? ttf.writeOptions.hinting : false;
            ttf.glyf.forEach(function (glyf) {
                var glyfSupport = {};
                glyfSupport = glyf.compound ? glyfSupport : getFlags(glyf, glyfSupport);

                var glyfSize = glyf.compound
                    ? sizeofCompound(glyf, hinting)
                    : sizeofSimple(glyf, glyfSupport, hinting);
                var size = glyfSize;

                // 4字节对齐
                if (size % 4) {
                    size += 4 - size % 4;
                }

                glyfSupport.glyfSize = glyfSize;
                glyfSupport.size = size;

                ttf.support.glyf.push(glyfSupport);

                tableSize += size;
            });

            ttf.support.glyf.tableSize = tableSize;

            // 写header的indexToLocFormat
            ttf.head.indexToLocFormat = tableSize > 65536 ? 1 : 0;

            return ttf.support.glyf.tableSize;
        }
5977
def info(ctx):
    
    controller = ctx.obj['controller']

    if controller.is_fips:
        click.echo('FIPS Approved Mode: {}'.format(
                'Yes' if controller.is_in_fips_mode else 'No'))
    else:
        if controller.has_pin:
            try:
                click.echo(
                    'PIN is set, with {} tries left.'.format(
                        controller.get_pin_retries()))
            except CtapError as e:
                if e.code == CtapError.ERR.PIN_BLOCKED:
                    click.echo('PIN is blocked.')
        else:
            click.echo('PIN is not set.')
633452
public static int getfd(FileDescriptor descriptor)
    {
        Field field = FBUtilities.getProtectedField(descriptor.getClass(), "fd");

        if (field == null)
            return -1;

        try
        {
            return field.getInt(descriptor);
        }
        catch (Exception e)
        {
            JVMStabilityInspector.inspectThrowable(e);
            logger.warn("unable to read fd field from FileDescriptor");
        }

        return -1;
    }
389335
private static int acquireFileEncodingCcsid() {
        // Get the charset represented by file.encoding
        Charset charset = null;
        String fileEncoding = System.getProperty("file.encoding");
        try {
            charset = Charset.forName(fileEncoding);
        } catch (Throwable t) {
            // Problem with the JVM's file.encoding property
        }

        int ccsid = getCcsid(charset);
        if (ccsid == 0) {
            System.err.println(MessageFormat.format(BootstrapConstants.messages.getString("warn.fileEncodingNotFound"), fileEncoding));
        }
        return ccsid;
    }
420759
def fcd2dri(inpFCD, outSTRM, ignored):
    
    # print >> outSTRM, "v1\n<t>,<v>,<grad>,<n>\n[s],[km/h],[%],[1/min]\n"
    print("v1\n<t>,<v>,<grad>\n[s],[km/h],[%]", file=outSTRM)
    for q in inpFCD:
        if q.vehicle:
            for v in q.vehicle:
                percSlope = math.sin(float(v.slope)) * 100.
                print("%s,%.3f,%s" % (
                    sumolib._intTime(q.time), float(v.speed) * 3.6, percSlope), file=outSTRM)
1309488
function modAnalyse() {
        var requireModules = [];
        var requireModulesIndex = {};

        /**
         * 添加需要请求的模块
         *
         * @ignore
         * @param {string} id 模块id
         */
        function addRequireModule( id ) {
            if ( modModules[ id ] || requireModulesIndex[ id ] ) {
                return;
            }

            requireModules.push( id );
            requireModulesIndex[ id ] = 1;
        }

        each( modModuleList, function ( module ) {
            if ( module.state > MODULE_PRE_DEFINED ) {
                return;
            }

            // 处理define中显式声明的dependencies
            var deps = module.deps.slice( 0 );
            var declareDepsCount = deps.length;
            var hardDependsCount = 0;

            // 分析function body中的require
            // 如果包含显式依赖声明，为性能考虑，可以不分析factoryBody
            // AMD的说明是`SHOULD NOT`，不过这里还是分析了
            var factory = module.factory;
            if ( typeof factory === 'function' ) {
                hardDependsCount = Math.min( factory.length, declareDepsCount );
                factory.toString()
                    .replace( COMMENT_RULE, '' )
                    .replace( REQUIRE_RULE, function ( $0, $1, depId ) {
                        deps.push( depId );
                    });
            }

            each( deps, function ( depId, index ) {
                var idInfo = parseId( depId );
                var absId = normalize( idInfo.module, module.id );
                var moduleInfo, resInfo;

                if ( absId && !BUILDIN_MODULE[ absId ] ) {
                    // 如果依赖是一个资源，将其信息添加到module.depRs
                    //
                    // module.depRs中的项有可能是重复的。
                    // 在这个阶段，加载resource的module可能还未defined，导致此时resource id无法被normalize。
                    // 比如对a/b/c而言，下面几个resource可能指的是同一个资源：
                    // - js!../name.js
                    // - js!a/name.js
                    // - ../../js!../name.js
                    //
                    // 所以加载资源的module ready时，需要遍历module.depRs进行处理
                    if ( idInfo.resource ) {
                        resInfo = {
                            id       : depId,
                            module   : absId,
                            resource : idInfo.resource
                        };
                        module.depPMs[ absId ] = 1;
                        module.depRs.push( resInfo );
                    }

                    // 对依赖模块的id normalize能保证正确性，在此处进行去重
                    moduleInfo = module.depMsIndex[ absId ];
                    if ( !moduleInfo ) {
                        moduleInfo = {
                            id       : idInfo.module,
                            absId    : absId,
                            hard     : index < hardDependsCount,
                            circular : CIRCULAR_DEP_UNREADY
                        };
                        module.depMs.push( moduleInfo );
                        module.depMsIndex[ absId ] = moduleInfo;
                        addRequireModule( absId );
                    }
                }
                else {
                    moduleInfo = { absId: absId };
                }

                // 如果当前正在分析的依赖项是define中声明的，
                // 则记录到module.factoryDeps中
                // 在factory invoke前将用于生成invoke arguments
                if ( index < declareDepsCount ) {
                    module.factoryDeps.push( resInfo || moduleInfo );
                }
            } );

            module.state = MODULE_ANALYZED;
            each(
                module.depMs,
                function ( moduleInfo ) {
                    modMonitorDependencyDefined( module.id, moduleInfo.absId );
                }
            );
            modTryDefine( module );
        });

        nativeRequire( requireModules );
    }