可平仓数量

        Returns:
            [type] -- [description]
760462
def close_available(self):
        
        return {
            'volume_long': self.volume_long - self.volume_long_frozen,
            'volume_short': self.volume_short - self.volume_short_frozen
        }
319616
def getUnitCost(self, CorpNum, MsgType, UserID=None):
        
        if MsgType is None or MsgType == "":
            raise PopbillException(-99999999, "전송유형이 입력되지 않았습니다.")

        result = self._httpget("/KakaoTalk/UnitCost?Type=" + MsgType, CorpNum)
        return float(result.unitCost)
801389
function () {
		var axis = this,
			isLog = axis.isLog;

		return {
			min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,
			max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,
			dataMin: axis.dataMin,
			dataMax: axis.dataMax,
			userMin: axis.userMin,
			userMax: axis.userMax
		};
	}
809348
def Task_display(self):
    
    re = """%(stock_name)s %(stock_no)s %(stock_date)s
Today: %(stock_price)s %(stock_range)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]),
      }
    return re
560884
def warp(self, order):
        

        # 因为成交模式对时间的封装

        if order.order_model == ORDER_MODEL.MARKET:

            if order.frequence is FREQUENCE.DAY:
                # exact_time = str(datetime.datetime.strptime(
                #     str(order.datetime), '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1))

                order.date = order.datetime[0:10]
                order.datetime = '{} 09:30:00'.format(order.date)
            elif order.frequence in [FREQUENCE.ONE_MIN,
                                     FREQUENCE.FIVE_MIN,
                                     FREQUENCE.FIFTEEN_MIN,
                                     FREQUENCE.THIRTY_MIN,
                                     FREQUENCE.SIXTY_MIN]:
                exact_time = str(
                    datetime.datetime
                    .strptime(str(order.datetime),
                              '%Y-%m-%d %H:%M:%S') +
                    datetime.timedelta(minutes=1)
                )
                order.date = exact_time[0:10]
                order.datetime = exact_time
            self.market_data = self.get_market(order)
            if self.market_data is None:
                return order
            order.price = (
                float(self.market_data["high"]) +
                float(self.market_data["low"])
            ) * 0.5
        elif order.order_model == ORDER_MODEL.NEXT_OPEN:
            try:
                exact_time = str(
                    datetime.datetime
                    .strptime(str(order.datetime),
                              '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)
                )
                order.date = exact_time[0:10]
                order.datetime = '{} 09:30:00'.format(order.date)
            except:
                order.datetime = '{} 15:00:00'.format(order.date)
            self.market_data = self.get_market(order)
            if self.market_data is None:
                return order
            order.price = float(self.market_data["close"])
        elif order.order_model == ORDER_MODEL.CLOSE:

            try:
                order.datetime = self.market_data.datetime
            except:
                if len(str(order.datetime)) == 19:
                    pass
                else:
                    order.datetime = '{} 15:00:00'.format(order.date)
            self.market_data = self.get_market(order)
            if self.market_data is None:
                return order
            order.price = float(self.market_data["close"])

        elif order.order_model == ORDER_MODEL.STRICT:
            '加入严格模式'
            if order.frequence is FREQUENCE.DAY:
                exact_time = str(
                    datetime.datetime
                    .strptime(order.datetime,
                              '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)
                )

                order.date = exact_time[0:10]
                order.datetime = '{} 09:30:00'.format(order.date)
            elif order.frequence in [FREQUENCE.ONE_MIN,
                                     FREQUENCE.FIVE_MIN,
                                     FREQUENCE.FIFTEEN_MIN,
                                     FREQUENCE.THIRTY_MIN,
                                     FREQUENCE.SIXTY_MIN]:
                exact_time = str(
                    datetime.datetime
                    .strptime(order.datetime,
                              '%Y-%m-%d %H-%M-%S') +
                    datetime.timedelta(minute=1)
                )
                order.date = exact_time[0:10]
                order.datetime = exact_time
            self.market_data = self.get_market(order)
            if self.market_data is None:
                return order
            if order.towards == 1:
                order.price = float(self.market_data["high"])
            else:
                order.price = float(self.market_data["low"])

        return order
655050
def get_header(self, configuration=False):
        
        header = [u"-----",
                  u"   █████╗ ██╗     ██╗ ██████╗ ███╗   ██╗ █████╗ ██╗  ██╗",
                  u"  ██╔══██╗██║     ██║██╔════╝ ████╗  ██║██╔══██╗██║ ██╔╝",
                  u"  ███████║██║     ██║██║  ███╗██╔██╗ ██║███████║█████╔╝ ",
                  u"  ██╔══██║██║     ██║██║   ██║██║╚██╗██║██╔══██║██╔═██╗ ",
                  u"  ██║  ██║███████╗██║╚██████╔╝██║ ╚████║██║  ██║██║  ██╗",
                  u"  ╚═╝  ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝  ╚═╝",
                  u"-----",
                  u"Alignak %s - %s daemon" % (VERSION, self.name),
                  u"Copyright (c) 2015-2019: Alignak Team",
                  u"License: AGPL",
                  u"-----",
                  u"Python: %s.%s" % (sys.version_info.major, sys.version_info.minor),
                  u"-----",
                  u"My pid: %s" % self.pid]

        if configuration:
            header = ["My configuration: "]
            for prop, _ in sorted(self.properties.items()):
                header.append(" - %s=%s" % (prop, getattr(self, prop)))

        return header
251134
public float getHorizontalScaling() {
		if (attributes == null)
			return 1f;
		Float f = (Float) attributes.get(HSCALE);
		if (f == null)
			return 1f;
		return f.floatValue();
	}
542039
def raw(self) -> str:
        
        doc = """Version: {0}
Type: Transaction
Currency: {1}
""".format(self.version,
           self.currency)

        if self.version >= 3:
            doc += "Blockstamp: {0}\n".format(self.blockstamp)

        doc += "Locktime: {0}\n".format(self.locktime)

        doc += "Issuers:\n"
        for p in self.issuers:
            doc += "{0}\n".format(p)

        doc += "Inputs:\n"
        for i in self.inputs:
            doc += "{0}\n".format(i.inline(self.version))

        doc += "Unlocks:\n"
        for u in self.unlocks:
            doc += "{0}\n".format(u.inline())

        doc += "Outputs:\n"
        for o in self.outputs:
            doc += "{0}\n".format(o.inline())

        doc += "Comment: "
        doc += "{0}\n".format(self.comment)

        return doc
26559
function() {

      // asinh(c) = log(c + sqrt(c^2 + 1))

      var tmp = this['im'];
      this['im'] = -this['re'];
      this['re'] = tmp;
      var res = this['asin']();

      this['re'] = -this['im'];
      this['im'] = tmp;
      tmp = res['re'];

      res['re'] = -res['im'];
      res['im'] = tmp;
      return res;
    }
894332
def column(self):
        """"""
        line = self.line
        return self._element.start - self._element.module.charindex(line, 0)
508539
def get_description(self):
        
        return DisplayText({'text': profile.DESCRIPTION,
                            'languageTypeId': profile.LANGUAGETYPEID,
                            'scriptTypeId': profile.SCRIPTTYPEID,
                            'formatTypeId': profile.FORMATTYPEID})
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
1090457
private String formatAccrueType(AccrueType type)
   {
      return (type == null ? null : LocaleData.getStringArray(m_locale, LocaleData.ACCRUE_TYPES)[type.getValue() - 1]);
   }
614938
def dpar(self, cl=1):
        
        sval = self.toString(self.value, quoted=1)
        if not cl:
            if sval == "": sval = "None"
        s = "%s = %s" % (self.name, sval)
        return s
958987
def get_currency(currency_str):
    
    path = 'units/currencies.csv'  # always use slash in Python packages
    filepath = pkg_resources.resource_filename('mpu', path)
    with open(filepath, 'r') as fp:
        reader = csv.reader(fp, delimiter=',', quotechar='"')
        next(reader, None)  # skip the headers
        for row in reader:
            is_currency = currency_str in [row[0], row[1], row[2]]
            if is_currency:
                entity = row[0]
                name = row[1]
                code = row[2]
                numeric_code = row[3]
                symbol = row[4]
                if len(row[5]) == 0:
                    exponent = None
                else:
                    exponent = int(row[5])
                if len(row[6]) > 0:
                    withdrawal_date = row[6]
                else:
                    withdrawal_date = None
                subunits = row[7]
                return Currency(name=name,
                                code=code,
                                numeric_code=numeric_code,
                                symbol=symbol,
                                exponent=exponent,
                                entities=[entity],
                                withdrawal_date=withdrawal_date,
                                subunits=subunits)
    raise ValueError('Could not find currency \'{}\''.format(currency_str))
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
470416
def display_format
      value = self.format_str ||
        I18n.t(self.format, :scope => [:bento_search, :format], :default => self.format.to_s.titleize)

      return value.blank? ? nil : value
    end