code: func PullImage(name string, d Docker, policy api.PullPolicy) (*PullResult, error) {
  	if len(policy) == 0 {
  		return nil, errors.New("the policy for pull image must be set")
  	}
  
  	var (
  		image *api.Image
  		err   error
  	)
  	switch policy {
  	case api.PullIfNotPresent:
  		image, err = d.CheckAndPullImage(name)
  	case api.PullAlways:
  		glog.Infof("Pulling image %q ...", name)
  		image, err = d.PullImage(name)
  	case api.PullNever:
  		glog.Infof("Checking if image %q is available locally ...", name)
  		image, err = d.CheckImage(name)
  	}
  	return &PullResult{Image: image, OnBuild: d.IsImageOnBuild(name)}, err
  }
docs: // PullImage pulls the Docker image specified by name taking the pull policy
  // into the account.