code: func GetBuilds(c context.Context, q Query) (*QueryResult, error) {
  	switch {
  	case q.Master == "":
  		return nil, errors.New("master is required")
  	case q.Builder == "":
  		return nil, errors.New("builder is required")
  	}
  
  	if !EmulationEnabled(c) {
  		return getDatastoreBuilds(c, q, true)
  	}
  
  	var emulatedBuilds, buildbotBuilds []*buildbot.Build
  	err := parallel.FanOutIn(func(work chan<- func() error) {
  		work <- func() (err error) {
  			res, err := getDatastoreBuilds(c, q, false)
  			if res != nil {
  				buildbotBuilds = res.Builds
  			}
  			return
  		}
  		work <- func() (err error) {
  			emulatedBuilds, err = getEmulatedBuilds(c, q)
  			return
  		}
  	})
  	if err != nil {
  		return nil, errors.Annotate(err, "could not load builds").Err()
  	}
  
  	mergedBuilds := mergeBuilds(emulatedBuilds, buildbotBuilds)
  	if q.Limit > 0 && len(mergedBuilds) > q.Limit {
  		mergedBuilds = mergedBuilds[:q.Limit]
  	}
  	return &QueryResult{Builds: mergedBuilds}, nil
  }
docs: // GetBuilds executes a build query and returns results.
  // Does not check access.