code: func CheckInstanceExists(c context.Context, inst *Instance) error {
  	switch err := datastore.Get(c, inst); {
  	case err == datastore.ErrNoSuchEntity:
  		// Maybe the package is missing completely?
  		if err := CheckPackageExists(c, inst.Package.StringID()); err != nil {
  			return err
  		}
  		return errors.Reason("no such instance").Tag(grpcutil.NotFoundTag).Err()
  	case err != nil:
  		return errors.Annotate(err, "failed to check the instance presence").Tag(transient.Tag).Err()
  	default:
  		return nil
  	}
  }
docs: // CheckInstanceExists fetches the instance and verifies it exists.
  //
  // Can be called as part of a transaction. Updates 'inst' in place.
  //
  // Returns gRPC-tagged NotFound error if there's no such instance or package.