code: def unpack_rsp(cls, rsp_pb):
          
          if rsp_pb.retType != RET_OK:
              return RET_ERROR, rsp_pb.retMsg, None
  
          raw_position_list = rsp_pb.s2c.positionList
  
          position_list = [{
                               "code": merge_trd_mkt_stock_str(rsp_pb.s2c.header.trdMarket, position.code),
                               "stock_name": position.name,
                               "qty": position.qty,
                               "can_sell_qty": position.canSellQty,
                               "cost_price": position.costPrice if position.HasField('costPrice') else 0,
                               "cost_price_valid": 1 if position.HasField('costPrice') else 0,
                               "market_val": position.val,
                               "nominal_price": position.price,
                               "pl_ratio": 100 * position.plRatio if position.HasField('plRatio') else 0,
                               "pl_ratio_valid": 1 if position.HasField('plRatio') else 0,
                               "pl_val": position.plVal if position.HasField('plVal') else 0,
                               "pl_val_valid": 1 if position.HasField('plVal') else 0,
                               "today_buy_qty": position.td_buyQty if position.HasField('td_buyQty') else 0,
                               "today_buy_val": position.td_buyVal if position.HasField('td_buyVal') else 0,
                               "today_pl_val": position.td_plVal if position.HasField('td_plVal') else 0,
                               "today_sell_qty": position.td_sellQty if position.HasField('td_sellQty') else 0,
                               "today_sell_val": position.td_sellVal if position.HasField('td_sellVal') else 0,
                               "position_side": TRADE.REV_POSITION_SIDE_MAP[position.positionSide]
                                  if position.positionSide in TRADE.REV_POSITION_SIDE_MAP else PositionSide.NONE,
                           } for position in raw_position_list]
          return RET_OK, "", position_list
docs: Convert from PLS response to user response