docstr: Create a Catalyst order object from a CCXT order dictionary
  
  Parameters
  ----------
  order_status: dict[str, Object]
      The order dict from the CCXT api.
  
  Returns
  -------
  Order
      The Catalyst order object
docstr_tok: ["Create","a","Catalyst","order","object","from","a","CCXT","order","dictionary","Parameters","--","--","--","--","--","order_status",":","dict","[","str",",","Object","]","The","order","dict","from","the","CCXT","api",".","Returns","--","--","--","-","Order","The","Catalyst","order","object"]
code: def _create_order(self, order_status):
      """
      Create a Catalyst order object from a CCXT order dictionary
  
      Parameters
      ----------
      order_status: dict[str, Object]
          The order dict from the CCXT api.
  
      Returns
      -------
      Order
          The Catalyst order object
  
      """
      order_id = order_status["id"]
      symbol = self.get_symbol(order_status["symbol"], source="ccxt")
      asset = self.get_asset(symbol)
  
      s = order_status["status"]
      amount = order_status["amount"]
      filled = order_status["filled"]
  
      if s == "canceled" or (s == "closed" and filled == 0):
          status = ORDER_STATUS.CANCELLED
  
      elif s == "closed" and filled > 0:
          if filled < amount:
              log.warn(
                  "order {id} is executed but only partially filled:"
                  " {filled} {symbol} out of {amount}".format(
                      id=order_status["status"],
                      filled=order_status["filled"],
                      symbol=asset.symbol,
                      amount=order_status["amount"],
                  )
              )
          else:
              log.info(
                  "order {id} executed in full: {filled} {symbol}".format(
                      id=order_id,
                      filled=filled,
                      symbol=asset.symbol,
                  )
              )
  
          status = ORDER_STATUS.FILLED
  
      elif s == "open":
          status = ORDER_STATUS.OPEN
  
      elif filled > 0:
          log.info(
              "order {id} partially filled: {filled} {symbol} out of "
              "{amount}, waiting for complete execution".format(
                  id=order_id,
                  filled=filled,
                  symbol=asset.symbol,
                  amount=amount,
              )
          )
          status = ORDER_STATUS.OPEN
  
      else:
          log.warn("invalid state {} for order {}".format(s, order_id))
          status = ORDER_STATUS.OPEN
  
      if order_status["side"] == "sell":
          amount = -amount
          filled = -filled
  
      price = order_status["price"]
      order_type = order_status["type"]
  
      limit_price = price if order_type == "limit" else None
  
      if "price" in order_status:
          executed_price = order_status["price"]
      elif "cost" in order_status and "amount" in order_status:
          executed_price = order_status["cost"] / order_status["amount"]
      else:
          executed_price = None
      commission = order_status["fee"]
      date = from_ms_timestamp(order_status["timestamp"])
  
      order = Order(
          dt=date,
          asset=asset,
          amount=amount,
          stop=None,
          limit=limit_price,
          filled=filled,
          id=order_id,
          commission=commission,
      )
      order.status = status
  
      return order, executed_price
  
imports: import copy
  import json
  import os
  import re
  from collections import defaultdict
  import ccxt
  import pandas
  import six
  from ccxt import InvalidOrder, NetworkError, ExchangeError, RequestTimeout
  from logbook import Logger
  from six import string_types
  from catalyst.algorithm import MarketOrder
  from catalyst.assets._assets import TradingPair
  from catalyst.constants import LOG_LEVEL
  from catalyst.exchange.exchange import Exchange
  from catalyst.exchange.exchange_bundle import ExchangeBundle
  from catalyst.exchange.exchange_errors import InvalidHistoryFrequencyError, ExchangeSymbolsNotFound, ExchangeRequestError, InvalidOrderStyle, ExchangeNotFoundError, CreateOrderError, InvalidHistoryTimeframeError, UnsupportedHistoryFrequencyError
  from catalyst.exchange.exchange_execution import ExchangeLimitOrder
  from catalyst.exchange.utils.exchange_utils import mixin_market_params, get_exchange_folder, get_catalyst_symbol, get_exchange_auth
  from catalyst.exchange.utils.datetime_utils import from_ms_timestamp, get_epoch, get_periods_range
  from catalyst.finance.order import Order, ORDER_STATUS
  from catalyst.finance.transaction import Transaction
  from redo import retry
label_desc: Use image node_id 20 for calling the CCXT obj's underlying member method code with example usage: obj._create_order(order_status) and returns: order,  executed_price