code: func fetchExistingInstances(c context.Context, keys []*datastore.Key) ([]*Instance, error) {
  	instances := make([]*Instance, len(keys))
  	for i, k := range keys {
  		instances[i] = &Instance{
  			InstanceID: k.StringID(),
  			Package:    k.Parent(),
  		}
  	}
  
  	err := datastore.Get(c, instances)
  	if err == nil {
  		return instances, nil
  	}
  
  	merr, ok := err.(errors.MultiError)
  	if !ok {
  		return nil, errors.Annotate(err, "failed to fetch instances").Tag(transient.Tag).Err()
  	}
  
  	existing := instances[:0]
  	for i, inst := range instances {
  		switch err := merr[i]; {
  		case err == nil:
  			existing = append(existing, inst)
  		case err != datastore.ErrNoSuchEntity:
  			return nil, errors.Annotate(err, "failed to fetch instance %q", inst.InstanceID).Tag(transient.Tag).Err()
  		}
  	}
  	return existing, nil
  }
docs: // fetchExistingInstances fetches Instance entities given their keys.
  //
  // Skips missing ones.