code: def test_get_percent_alloc(self):
      raw_data = arange(15, dtype=float).reshape(5, 3)
      # Make the first column negative to test absolute magnitudes.
      raw_data[:, 0] *= -1
  
      frame = DataFrame(
          raw_data,
          index=date_range("01-01-2015", freq="D", periods=5),
          columns=["A", "B", "C"],
      )
  
      result = get_percent_alloc(frame)
      expected_raw = zeros_like(raw_data)
      for idx, row in enumerate(raw_data):
          expected_raw[idx] = row / row.sum()
  
      expected = DataFrame(
          expected_raw,
          index=frame.index,
          columns=frame.columns,
      )
  
      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 1 for calling the PositionsTestCase obj's underlying member method code with example usage: obj.test_get_percent_alloc() without return types