

def portfolio_to_dict(portfolio):
    json_pf = copy.deepcopy(infos).__dict__
    if json_pf['positions']:
        for (sid, infos) in portfolio.positions.iteritems():
            json_pf['positions'][sid] = infos.__dict__
    return json_pf

dataset/ETHPy150Open intuition-io/insights/insights/plugins/database/utils.py portfolio_to_dict/VarMisuse@16/23 `portfolio`->`infos`