code: def _assign_entity_to_pb(entity_pb, entity):
      
      bare_entity_pb = helpers.entity_to_protobuf(entity)
      bare_entity_pb.key.CopyFrom(bare_entity_pb.key)
      entity_pb.CopyFrom(bare_entity_pb)
docs: Copy ``entity`` into ``entity_pb``.
  
      Helper method for ``Batch.put``.
  
      :type entity_pb: :class:`.entity_pb2.Entity`
      :param entity_pb: The entity owned by a mutation.
  
      :type entity: :class:`google.cloud.datastore.entity.Entity`
      :param entity: The entity being updated within the batch / transaction.