code: def as_account(self):
      account = self._account_store
  
      pt = self.position_tracker
      pos_stats = pt.stats()
      period_stats = calc_period_stats(pos_stats, self.ending_cash)
  
      # If no attribute is found on the PerformancePeriod resort to the
      # following default values. If an attribute is found use the existing
      # value. For instance, a broker may provide updates to these
      # attributes. In this case we do not want to over write the broker
      # values with the default values.
      account.settled_cash = getattr(
          self, "settled_cash", self.ending_cash
      )
      account.accrued_interest = getattr(self, "accrued_interest", 0.0)
      account.buying_power = getattr(self, "buying_power", float("inf"))
      account.equity_with_loan = getattr(
          self, "equity_with_loan", self.ending_cash + self.ending_value
      )
      account.total_positions_value = getattr(
          self, "total_positions_value", self.ending_value
      )
      account.total_positions_exposure = getattr(
          self, "total_positions_exposure", self.ending_exposure
      )
      account.regt_equity = getattr(
          self, "regt_equity", self.ending_cash
      )
      account.regt_margin = getattr(self, "regt_margin", float("inf"))
      account.initial_margin_requirement = getattr(
          self, "initial_margin_requirement", 0.0
      )
      account.maintenance_margin_requirement = getattr(
          self, "maintenance_margin_requirement", 0.0
      )
      account.available_funds = getattr(
          self, "available_funds", self.ending_cash
      )
      account.excess_liquidity = getattr(
          self, "excess_liquidity", self.ending_cash
      )
      account.cushion = getattr(
          self,
          "cushion",
          self.ending_cash / (self.ending_cash + self.ending_value),
      )
      account.day_trades_remaining = getattr(
          self, "day_trades_remaining", float("inf")
      )
      account.leverage = getattr(
          self, "leverage", period_stats.gross_leverage
      )
      account.net_leverage = getattr(
          self, "net_leverage", period_stats.net_leverage
      )
      account.net_liquidation = getattr(
          self, "net_liquidation", period_stats.net_liquidation
      )
      return account
  
imports: from __future__ import division
  import logbook
  import numpy
  from collections import namedtuple
  from catalyst.assets import Future
  from six import itervalues, iteritems
  import catalyst.protocol
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 24 for calling the PerformancePeriod obj's underlying member method code with example usage: obj.as_account() and returns: account