code: func determineJobState(heartbeat, tgt string, us *unit.UnitState) (state job.JobState) {
  	state = job.JobStateInactive
  
  	if tgt == "" || us == nil {
  		return
  	}
  
  	state = job.JobStateLoaded
  
  	if heartbeat != tgt {
  		return
  	}
  
  	state = job.JobStateLaunched
  	return
  }
docs: // determineJobState decides what the State field of a Job object should
  // be, based on three parameters:
  //  - heartbeat should be the machine ID that is known to have recently
  //    heartbeaten (see UnitHeartbeat) the Unit.
  //  - tgt should be the machine ID to which the Job is currently scheduled
  //  - us should be the most recent UnitState