<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put_multi(entities):
 """Persist a set of entities to Datastore. Note: This uses the adapter that is tied to the first Entity in the list. If the entities have disparate adapters this function may behave in unexpected ways. Warning: You must pass a **list** and not a generator or some other kind of iterable to this function as it has to iterate over the list of entities multiple times. Parameters: entities(list[Model]):
 The list of entities to persist. Raises: RuntimeError: If the given set of models use a disparate set of adapters. Returns: list[Model]: The list of persisted entitites. """

    if not entities:
        return []

    adapter, requests = None, []
    for entity in entities:
        if adapter is None:
            adapter = entity._adapter

        entity.pre_put_hook()
        requests.append(PutRequest(entity.key, entity.unindexed_properties, entity))

    keys = adapter.put_multi(requests)
    for key, entity in zip(keys, entities):
        entity.key = key
        entity.post_put_hook()

    return entities