code: func (agent *Agent) downloadSwarmingBotCode(ctx context.Context, server, path string) error {
  	_, err := os.Stat(path)
  	if err == nil {
  		logging.Infof(ctx, "Already installed: %s.", path)
  		return nil
  	}
  
  	logging.Infof(ctx, "Downloading: %s.", path)
  	response, err := agent.client.Get(server + "/bot_code")
  	if err != nil {
  		return err
  	}
  	defer response.Body.Close()
  	if response.StatusCode != 200 {
  		// TODO(smut): Differentiate between transient and non-transient.
  		return errors.New("unexpected HTTP status: " + response.Status)
  	}
  	out, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0644)
  	if err != nil {
  		return err
  	}
  	defer out.Close()
  	_, err = io.Copy(out, response.Body)
  	if err != nil {
  		return err
  	}
  	return agent.strategy.chown(ctx, agent.swarmingUser, path)
  }
docs: // downloadSwarminBotCode downloads the Swarming bot code from the given server.