docs: def view_portfolio_losses(token, dstore):
      """
      The losses for the full portfolio, for each realization and loss type,
      extracted from the event loss table.
      """
      oq = dstore['oqparam']
      loss_dt = oq.loss_dt()
      data = portfolio_loss(dstore).view(loss_dt)[:, 0]
      rlzids = [str(r) for r in range(len(data))]
      array = util.compose_arrays(numpy.array(rlzids), data, 'rlz')
      # this is very sensitive to rounding errors, so I am using a low precision
      return rst_table(array, fmt='%.5E')