code: func CheckInstanceReady(c context.Context, inst *Instance) error {
  	switch err := CheckInstanceExists(c, inst); {
  	case err != nil:
  		return err
  	case len(inst.ProcessorsFailure) != 0:
  		return errors.Reason("some processors failed to process this instance: %s",
  			strings.Join(inst.ProcessorsFailure, ", ")).Tag(grpcutil.AbortedTag).Err()
  	case len(inst.ProcessorsPending) != 0:
  		return errors.Reason("the instance is not ready yet, pending processors: %s",
  			strings.Join(inst.ProcessorsPending, ", ")).Tag(grpcutil.FailedPreconditionTag).Err()
  	default:
  		return nil
  	}
  }
docs: // CheckInstanceReady fetches the instance and verifies it exists and has zero
  // pending or failed processors.
  //
  // Can be called as part of a transaction. Updates 'inst' in place.
  //
  // Returns gRPC-tagged errors:
  //    NotFound if there's no such instance or package.
  //    FailedPrecondition if some processors are still running.
  //    Aborted if some processors have failed.