import copy


def _deep_copy_pm_results(result_pm):
    """Deep copy pm solution, to keep the original output of PowerModels."""
    
    pm = {key: (val if key != "solution" else copy.deepcopy(val))
          for key, val in result_pm.items()}

    return pm