class_docstr: The correctness of the metrics of Account in nested execution depends on the shallow copy of `trade_account` in
  qlib/backtest/executor.py:NestedExecutor
  Different level of executor has different Account object when calculating metrics. But the position object is
  shared cross all the Account object.
docstr: get the history portfolio_metrics and positions instance
docstr_tok: ["get","the","history","portfolio_metrics","and","positions","instance"]
code: def get_portfolio_metrics(self) -> Tuple[pd.DataFrame, dict]:
      """get the history portfolio_metrics and positions instance"""
      if self.is_port_metr_enabled():
          assert self.portfolio_metrics is not None
          _portfolio_metrics = (
              self.portfolio_metrics.generate_portfolio_metrics_dataframe()
          )
          _positions = self.get_hist_positions()
          return _portfolio_metrics, _positions
      else:
          raise ValueError(
              "generate_portfolio_metrics should be True if you want to generate portfolio_metrics"
          )
  
imports: from __future__ import annotations
  import copy
  from typing import Dict, List, Optional, Tuple, cast
  import pandas
  from qlib.utils import init_instance_by_config
  from .decision import BaseTradeDecision, Order
  from .exchange import Exchange
  from .high_performance_ds import BaseOrderIndicator
  from .position import BasePosition
  from .report import Indicator, PortfolioMetrics
label_desc: Use image node_id 15 for calling the Account obj's underlying member method code with example usage: obj.get_portfolio_metrics() and returns: _portfolio_metrics,  _positions