判断某只股票是否全天停牌。

    :param str order_book_id: 某只股票的代码或股票代码，可传入单只股票的order_book_id, symbol

    :param int count: 回溯获取的数据个数。默认为当前能够获取到的最近的数据

    :return: count为1时 `bool`; count>1时 `pandas.DataFrame`
190785
def is_suspended(order_book_id, count=1):
    
    dt = Environment.get_instance().calendar_dt.date()
    order_book_id = assure_stock_order_book_id(order_book_id)
    return Environment.get_instance().data_proxy.is_suspended(order_book_id, dt, count)
1310466
def status_for_order(self, order_id, stock):
        
        url_fragment = 'venues/{venue}/stocks/{stock}/orders/{order_id}'.format(
            venue=self.venue,
            stock=stock,
            order_id=order_id,
        )
        url = urljoin(self.base_url, url_fragment)
        return self.session.get(url).json()
716517
def first(self, count=1):
        
        if count == 0:
            raise QueryInvalid("Count cannot be zero.")
        self.limit_count = count
        records = self._do_query().fetchall()
        if not records:
            return None
        if count == 1:
            record = records[0]
            args = dict(zip(self.attributes, record))
            return self.model.from_dict(**args)
        return self
1285410
def status(self):
        
        try:
            return self.__dict__["status"]
        except (KeyError, ValueError):
            raise AttributeError(
                "Instrument(order_book_id={}) has no attribute 'status' ".format(self.order_book_id)
            )
406127
def count(self):
        
        count = 0
        operation = self._get_operation()
        kwargs = self.kwargs.copy()
        kwargs['select'] = 'COUNT'
        limit = kwargs.get('limit', None)
        while True:
            result = operation(self.model.get_table_name(), **kwargs)
            count += result['Count']
            if limit is not None:
                limit -= result['Count']

            last_evaluated_key = result.get('LastEvaluatedKey', None)
            if not self._prepare_next_fetch(kwargs, last_evaluated_key, limit):
                break
        return count
1044273
def __place_order(self, token):
        
        order_id = 0
        response = None

        if not token or token['value'] == '':
            raise LendingClubError('The token parameter is False, None or unknown.')

        # Process order confirmation page
        try:
            # Place the order
            payload = {}
            if token:
                payload['struts.token.name'] = token['name']
                payload[token['name']] = token['value']
            response = self.lc.session.post('/portfolio/orderConfirmed.action', data=payload)

            # Process HTML for the order ID
            html = response.text
            soup = BeautifulSoup(html, 'html5lib')

            # Order num
            order_field = soup.find(id='order_id')
            if order_field:
                order_id = int(order_field['value'])

            # Did not find an ID
            if order_id == 0:
                self.__log('An investment order was submitted, but a confirmation ID could not be determined')
                raise LendingClubError('No order ID was found when placing the order.', response)
            else:
                return order_id

        except Exception as e:
            raise LendingClubError('Could not place the order: {0}'.format(str(e)), response)
808484
def info_count(i: int, n: int, *rest: Token, **kwargs: Any) -> None:
    
    num_digits = len(str(n))
    counter_format = "(%{}d/%d)".format(num_digits)
    counter_str = counter_format % (i + 1, n)
    info(green, "*", reset, counter_str, reset, *rest, **kwargs)
605252
def fetch_order_book(self) -> OrderBook:
        """"""
        return self._fetch('order book', self.market.code)(self._order_book)()
812105
def get_order(self, id, **data):
        
        
        return self.get("/orders/{0}/".format(id), data=data)
1188706
def count(self):
        '''
        
        '''
        args = self.format_args
        if args is None or \
                (isinstance(args, dict) and self.count_field not in args):
            raise TypeError("count is required")
        return args[self.count_field] if isinstance(args, dict) else args
524310
def QA_SU_save_order(orderlist, client=DATABASE):
    
    if isinstance(orderlist, pd.DataFrame):

        collection = client.order
        collection.create_index(
            [('account_cookie',
              ASCENDING),
             ('realorder_id',
              ASCENDING)],
            unique=True
        )
        try:

            orderlist = QA_util_to_json_from_pandas(orderlist.reset_index())

            for item in orderlist:
                if item:
                    #item['date']= QA_util_get_order_day()
                    collection.update_one(
                        {
                            'account_cookie': item.get('account_cookie'),
                            'realorder_id': item.get('realorder_id')
                        },
                        {'$set': item},
                        upsert=True
                    )
        except Exception as e:
            print(e)
            pass
246702
def lookup_order(self, order_id):
        
        self._log('look up order(s) {}'.format(order_id))
        return self._rest_client.post(
            endpoint='/lookup_order',
            payload={'id': order_id}
        )
523811
def providers_count(df):
    
    providers_count = {}
    cnpj_array = df.values

    for a in cnpj_array:
        cnpj = a[0]
        occurrences = providers_count.get(cnpj, 0)
        providers_count[cnpj] = occurrences + 1

    return pd.DataFrame.from_dict(providers_count, orient='index')
996282
def count(self, count):
        
        if count is None:
            raise ValueError("Invalid value for `count`, must not be `None`")
        if count is not None and count < 0:
            raise ValueError("Invalid value for `count`, must be a value greater than or equal to `0`")

        self._count = count
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)
            )
399929
public OkCoinOrderResult getOrder(String symbol, Integer type, String... orderIds)
      throws IOException {
    if (orderIds == null || orderIds.length > 50) {
      throw new UnsupportedOperationException(
          "Can only get 1 to 50 orders. " + orderIds.length + " orders provided.");
    }
    String ids = Arrays.stream(orderIds).collect(Collectors.joining(","));

    return super.getOrder(symbol, type, ids);
  }
481721
def special_type(self):
        
        try:
            return self.__dict__["special_type"]
        except (KeyError, ValueError):
            raise AttributeError(
                "Instrument(order_book_id={}) has no attribute 'special_type' ".format(self.order_book_id)
            )