old_contents: #!/usr/bin/env python
  
  # Copyright 2016 Google Inc. All Rights Reserved.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  
  def run_quickstart():
      # [START datastore_quickstart]
      # Imports the Google Cloud client library
      from google.cloud import datastore
  
      # Instantiates a client
      datastore_client = datastore.Client()
  
      # The kind of the entity to retrieve
      kind = 'Task'
      # The name/ID of the entity to retrieve
      name = 'sampletask1'
      # The Datastore key for the entity
      task_key = datastore_client.key(kind, name)
  
      # Retrieves the entity
      task = datastore_client.get(task_key)
  
      print('Fetched task: {}'.format(task.key.name))
      # [END datastore_quickstart]
  
  
  if __name__ == '__main__':
      run_quickstart()
  
new_contents: #!/usr/bin/env python
  
  # Copyright 2016 Google Inc. All Rights Reserved.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  
  def run_quickstart():
      # [START datastore_quickstart]
      # Imports the Google Cloud client library
      from google.cloud import datastore
  
      # Instantiates a client
      datastore_client = datastore.Client()
  
      # The kind for the new entity
      kind = 'Task'
      # The name/ID for the new entity
      name = 'sampletask1'
      # The Cloud Datastore key for the new entity
      task_key = datastore_client.key(kind, name)
  
      # Prepares the new entity
      task = datastore.Entity(key=task_key)
      task['description'] = 'Buy milk'
  
      # Saves the entity
      datastore_client.put(task)
  
      print('Saved {}: {}'.format(task.key.name, task['description']))
      # [END datastore_quickstart]
  
  
  if __name__ == '__main__':
      run_quickstart()
  
subject: Change datastore quickstart sample to create a task. (#561)