def _serialize_allocations_for_resource_provider(allocations, resource_provider):
 return _allocations_dict(allocations, (lambda x: x.consumer_id), resource_provider=resource_provider)

def _serialize_allocations_for_resource_provider ( allocations , resource_provider ) : return _allocations_dict ( allocations , ( lambda x : x . consumer_id ) , resource_provider = resource_provider )
turn a list of allocations into a dict by consumer id .