code: public Entity getEntityWithKey(String keyName) {
      // [START getEntityWithKey]
      Key key = datastore.newKeyFactory().setKind("MyKind").newKey(keyName);
      Entity entity = datastore.get(key);
      // Do something with the entity
      // [END getEntityWithKey]
      return entity;
    }
docs: [VARIABLE "my_key_name"]