code: func (container *Container) ShouldRestart() bool {
  	shouldRestart, _, _ := container.RestartManager().ShouldRestart(uint32(container.ExitCode()), container.HasBeenManuallyStopped, container.FinishedAt.Sub(container.StartedAt))
  	return shouldRestart
  }
docs: // ShouldRestart decides whether the daemon should restart the container or not.
  // This is based on the container's restart policy.