<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handleOrders(self, msg):
 """ handle order open & status """

        """
        It is possible that orderStatus() may return duplicate messages.
        It is essential that you filter the message accordingly.
        """

        # log handler msg
        self.log_msg("order", msg)

        # get server time
        self.getServerTime()
        time.sleep(0.001)

        # we need to handle mutiple events for the same order status
        duplicateMessage = False

        # open order
        if msg.typeName == dataTypes["MSG_TYPE_OPEN_ORDER"]:
            # contract identifier
            contractString = self.contractString(msg.contract)

            order_account = ""
            if msg.orderId in self.orders and self.orders[msg.orderId]["status"] == "SENT":
                order_account = self.orders[msg.orderId]["account"]
                try:
                    del self.orders[msg.orderId]
                except Exception:
                    pass

            if msg.orderId in self.orders:
                duplicateMessage = True
            else:
                self.orders[msg.orderId] = {
                    "id":       msg.orderId,
                    "symbol":   contractString,
                    "contract": msg.contract,
                    "order":    msg.order,
                    "status":   "OPENED",
                    "reason":   None,
                    "avgFillPrice": 0.,
                    "parentId": 0,
                    "time": datetime.fromtimestamp(int(self.time)),
                    "account": order_account
                }
                self._assgin_order_to_account(self.orders[msg.orderId])

        # order status
        elif msg.typeName == dataTypes["MSG_TYPE_ORDER_STATUS"]:
            if msg.orderId in self.orders and self.orders[msg.orderId]['status'] == msg.status.upper():
                duplicateMessage = True
            else:
                # remove cancelled orphan orders
                # if "CANCELLED" in msg.status.upper() and msg.parentId not in self.orders.keys():
                #     try: del self.orders[msg.orderId]
                #     except Exception: pass
                # # otherwise, update order status
                # else:
                self.orders[msg.orderId]['status']       = msg.status.upper()
                self.orders[msg.orderId]['reason']       = msg.whyHeld
                self.orders[msg.orderId]['avgFillPrice'] = float(msg.avgFillPrice)
                self.orders[msg.orderId]['parentId']     = int(msg.parentId)
                self.orders[msg.orderId]['time']         = datetime.fromtimestamp(int(self.time))

            # remove from orders?
            # if msg.status.upper() == 'CANCELLED':
            #     del self.orders[msg.orderId]

        # fire callback
        if duplicateMessage is False:
            # group orders by symbol
            self.symbol_orders = self.group_orders("symbol")
            self.ibCallback(caller="handleOrders", msg=msg)