code: func EmulationOf(c context.Context, id buildbot.BuildID) (*deprecated.Build, error) {
  	bb, err := buildbucketClient(c)
  	if err != nil {
  		return nil, err
  	}
  
  	bucket, err := BucketOf(c, id.Master)
  	switch {
  	case err != nil:
  		return nil, err
  	case bucket == "":
  		return nil, nil
  	}
  
  	msgs, _, err := bb.Search().
  		// this search is optimized, a datastore.get.
  		Tag(strpair.Format(bbv1.TagBuildAddress, bbv1.FormatBuildAddress(0, bucket, id.Builder, id.Number))).
  		Context(c).
  		Fetch(1, nil)
  	switch {
  	case err != nil:
  		return nil, err
  	case len(msgs) == 0:
  		return nil, nil
  	default:
  		var b deprecated.Build
  		return &b, b.ParseMessage(msgs[0])
  	}
  }
docs: // EmulationOf returns the Buildbucket build that the given Buildbot build is emulating.
  // Returns (nil, nil) if build is not found.