def get_long_short_pos(positions):
pos_wo_cash = positions.drop('<STR_LIT>', axis=<NUM_LIT:1>)<EOL>longs = pos_wo_cash[pos_wo_cash > <NUM_LIT:0>].sum(axis=<NUM_LIT:1>).fillna(<NUM_LIT:0>)<EOL>shorts = pos_wo_cash[pos_wo_cash < <NUM_LIT:0>].sum(axis=<NUM_LIT:1>).fillna(<NUM_LIT:0>)<EOL>cash = positions.cash<EOL>net_liquidation = longs + shorts + cash<EOL>df_pos = pd.DataFrame({'<STR_LIT>': longs.divide(net_liquidation, axis='<STR_LIT:index>'),<EOL>'<STR_LIT>': shorts.divide(net_liquidation,<EOL>axis='<STR_LIT:index>')})<EOL>df_pos['<STR_LIT>'] = df_pos['<STR_LIT>'] + df_pos['<STR_LIT>']<EOL>return df_pos<EOL>
Determines the long and short allocations in a portfolio.

Parameters
----------
positions : pd.DataFrame
    The positions that the strategy takes over time.

Returns
-------
df_long_short : pd.DataFrame
    Long and short allocations as a decimal
    percentage of the total net liquidation