code: def cancel_order(order):
      
      env = Environment.get_instance()
      if env.can_cancel_order(order):
          env.broker.cancel_order(order)
      return order
docs: 撤单
  
      :param order: 需要撤销的order对象
      :type order: :class:`~Order` object