code: func getBuild(c context.Context, id buildbot.BuildID, fetchAnnotations, fetchChanges bool) (*buildbot.Build, error) {
  	if !EmulationEnabled(c) {
  		return getDatastoreBuild(c, id)
  	}
  
  	// Is it a LUCI build?
  	build, err := getEmulatedBuild(c, id, fetchAnnotations, fetchChanges)
  	switch {
  	case err != nil:
  		return nil, err
  	case build != nil:
  		// does not exist or experimental.
  		return build, nil
  	}
  
  	// Is it a Buildbot build?
  	build, err = getDatastoreBuild(c, id)
  	switch {
  	case err != nil:
  		return nil, err
  	case build == nil:
  		return nil, nil
  	case build.Experimental():
  		return nil, nil
  	default:
  		return build, nil
  	}
  }
docs: // getBuild returns a build by master, builder and number.
  // The returned build may be coming from datastore or Buildbucket RPC.
  // Returns (nil, nil) if build is not found.