code: func NewMachinePool(c context.Context, botPool *model.BotPool) *MachinePool {
  	fiveMinAgo := clock.Now(c).Add(-time.Minute * 5)
  	result := &MachinePool{
  		Total:        len(botPool.Bots),
  		Bots:         make([]Bot, len(botPool.Bots)),
  		Dimensions:   botPool.Descriptor.Dimensions().Format(),
  		SwarmingHost: botPool.Descriptor.Host(),
  	}
  	for i, bot := range botPool.Bots {
  		uiBot := Bot{bot, bot.Status} // Wrap the model.Bot
  		if bot.Status == model.Offline && bot.LastSeen.After(fiveMinAgo) {
  			// If the bot has been offline for less than 5 minutes, mark it as busy.
  			uiBot.Status = model.Busy
  		}
  		switch bot.Status {
  		case model.Idle:
  			result.Idle++
  		case model.Busy:
  			result.Busy++
  		case model.Offline:
  			result.Offline++
  		}
  		result.Bots[i] = uiBot
  	}
  	return result
  }
docs: // NewMachinePool calculates stats from a model.Bot and generates a MachinePool.
  // This requires a context because setting the UI Status field requires the current time.