code: def test_extract_pos(self):
      index_dup = [
          Timestamp("2015-06-08", tz="UTC"),
          Timestamp("2015-06-08", tz="UTC"),
          Timestamp("2015-06-09", tz="UTC"),
          Timestamp("2015-06-09", tz="UTC"),
      ]
      index = [
          Timestamp("2015-06-08", tz="UTC"),
          Timestamp("2015-06-09", tz="UTC"),
      ]
  
      positions = DataFrame(
          {
              "amount": [100.0, 200.0, 300.0, 400.0],
              "last_sale_price": [10.0, 20.0, 30.0, 40.0],
              "sid": [1, 2, 1, 2],
          },
          index=index_dup,
      )
      cash = Series([100.0, 200.0], index=index)
  
      result = extract_pos(positions, cash)
  
      expected = DataFrame(
          OrderedDict(
              [
                  (1, [100.0 * 10.0, 300.0 * 30.0]),
                  (2, [200.0 * 20.0, 400.0 * 40.0]),
                  ("cash", [100.0, 200.0]),
              ]
          ),
          index=index,
      )
      expected.index.name = "index"
      expected.columns.name = "sid"
  
      assert_frame_equal(result, expected)
  
file_path: pyfolio/pyfolio/tests/test_pos.py
imports: from unittest import TestCase
  from nose_parameterized import parameterized
  from collections import OrderedDict
  import os
  import gzip
  from pandas import Series, DataFrame, date_range, Timestamp, read_csv
  from pandas.util.testing import assert_frame_equal
  from numpy import arange, zeros_like, nan
  import warnings
  from pyfolio.utils import to_utc, to_series, check_intraday, detect_intraday, estimate_intraday
  from pyfolio.pos import get_percent_alloc, extract_pos, get_sector_exposures, get_max_median_position_concentration
label_desc: Use image node_id 2 for calling the PositionsTestCase obj's underlying member method code with example usage: obj.test_extract_pos() without return types