code: def getEarliness(self):
          
          maxtime = self.getMaxTimeAllowed()
          if not maxtime:
              # No Turnaround time is set for this analysis
              return 0
          return api.to_minutes(**maxtime) - self.getDuration()
docs: The remaining time in minutes for this analysis to be completed.
          Returns zero if the analysis is neither 'ready to process' nor a
          turnaround time is set.
              earliness = duration - max_turnaround_time
          The analysis is late if the earliness is negative
          :return: the remaining time in minutes before the analysis reaches TAT
          :rtype: int