Returns the progress of the current build in the number between 0-100.

@return -1
if it's impossible to estimate the progress.
165060
@Exported
    public int getProgress() {
        long d = executableEstimatedDuration;
        if (d <= 0) {
            return DEFAULT_ESTIMATED_DURATION;
        }

        int num = (int) (getElapsedTime() * 100 / d);
        if (num >= 100) {
            num = 99;
        }
        return num;
    }
1009141
def get_progress(self):
        
        pos = self.reader.reader.tell()
        return min((pos - self.region_start) /
                   float(self.region_end - self.region_start),
                   1.0)
113054
public int compareTo(Version that) {

    if (that == null) {
      return 1;
    }

    if (major != that.major) {
      return major - that.major;
    }

    if (minor != that.minor) {
      return minor - that.minor;
    }

    if (bugfix != that.bugfix) {
      return bugfix - that.bugfix;
    }

    if (build != that.build) {
      return build - that.build;
    }

    return 0;
  }
1341611
public Long durationOfCompletedBuildInSeconds() {
        Date buildingDate = getStartedDateFor(JobState.Building);
        Date completedDate = getCompletedDate();
        if (buildingDate == null || completedDate == null) {
            return 0L;
        }
        Long elapsed = completedDate.getTime() - buildingDate.getTime();
        int elapsedSeconds = Math.round(elapsed / 1000);
        return Long.valueOf(elapsedSeconds);
    }
1186620
private int getPreviousStep(int currentStep) {
        int prevStep = -1;

        // we find the next available step.
        for (int i = currentStep - 1; i >= STEP_LOGIN; i--) {
            if(isStepEnabled(i)) {
                prevStep = i;
                break;
            }
        }

        return prevStep;
    }
556777
def _calculate_progress(self, match):
        '''
        
        '''
        if not self.progress_expr:
            return safe_float(match.group(1))
        else:
            return self._eval_progress(match)
1117997
def remaining_time(self):
        """"""
        if self.rate == 0:
            return None
        else:
            remaining_progress = self.done - self.current
            if self.rate == 0:
                if self.done == 0:
                    return 0
                else:
                    return None

            return remaining_progress / self.rate
410715
def calc_progress(self, completed_count, total_count):
        
        self.logger.debug(
            "calc_progress(%s, %s)",
            completed_count,
            total_count,
        )
        current_time = time.time()

        time_spent = current_time - self.start_time
        self.logger.debug("Progress time spent: %s", time_spent)

        if total_count == 0:
            return 100, 1

        completion_fraction = completed_count / total_count
        if completion_fraction == 0:
            completion_fraction = 1

        total_time = 0
        total_time = time_spent / completion_fraction
        time_remaining = total_time - time_spent

        completion_display = completion_fraction * 100
        if completion_display == 100:
            return 100, 1  # 1 second to finish up

        return completion_display, time_remaining
621252
protected JProgressBar getProgressBar() {
        if (progressBar == null) {
            progressBar = createProgressBar();
            Assert.notNull(progressBar, "createProgressBar should not return null");
        }
        return progressBar;
    }
723482
public double totalCount() {
    if (depth() == 1) {
      return total; // I think this one is always OK.  Not very principled here, though.
    } else {
      double result = 0.0;
      for (K o: topLevelKeySet()) {
        result += conditionalizeOnce(o).totalCount();
      }
      return result;
    }
  }
403186
@Override public float progress(){
    if(UKV.get(dest()) == null)return 0;
    DeepLearningModel m = UKV.get(dest());
    if (m != null && m.model_info()!=null ) {
      final float p = (float) Math.min(1, (m.epoch_counter / m.model_info().get_params().epochs));
      return cv_progress(p);
    }
    return 0;
  }
393677
public float progress() { update_from_remote();
    float regularProgress = _work==0 ? 0f : Math.min(1,(float)_worked/_work);
    if (_max_runtime_msecs>0) return Math.min(1,Math.max(regularProgress, (float)msec()/_max_runtime_msecs));
    return regularProgress;
  }
820161
private int calculateEndLevel() {

        int result = 0;
        if (m_navRootPath != null) {
            // where are we? (start level)

            StringTokenizer counter = new StringTokenizer(m_navRootPath, "/", false);
            // one less as level 0 nav elements accepted is one level (depth 1).
            result = counter.countTokens() - 1;
            if (!CmsResource.isFolder(m_navRootPath)) {
                // cut stuff like system/workpalce/locale/de/help/index.html
                result--;
            }
            result += m_depth;
        }
        if (result < 0) {
            result = 0;
        }
        return result;
    }
956410
public double getAverage() {
        readLock.lock();
        try {
            // any values at all, needed to avoid a DivideByZero exception
            if (this.values.size() <= 0) {
                return 0;
            }
            return ((double)this.total / (double)this.values.size());
        } finally {
            readLock.unlock();
        }
    }
344238
@Override
  public float getProgress() {
    try {
      return Math.max(Math.min(1, progressProvider.get().getProgress()), 0);
    } catch (final Exception e) {
      // An Exception must be caught and logged here because YARN swallows the Exception and fails the job.
      LOG.log(Level.WARNING, "Cannot get the application progress. Will return 0.", e);
      return 0;
    }
  }
767844
protected double getKnobPercent() {
		// If we have no range
		if (maxValue <= minValue) {
			return 0;
		}

		// Calculate the relative progress
		double percent = (curValue - minValue) / (maxValue - minValue);
		return Math.max(0.0, Math.min(1.0, percent));
	}
234409
private Double fetchBuildSuccessRatio(Iterable<Build> builds) {
    int totalBuilds = 0, totalSuccess = 0;
    for (Build build : builds) {
      if (Constants.IGNORE_STATUS.contains(build.getBuildStatus())) {
        continue;
      }

      totalBuilds++;
      if (Constants.SUCCESS_STATUS.contains(build.getBuildStatus())) {
        totalSuccess++;
      }
    }
    if (totalBuilds == 0) {
      return 0.0d;
    }
    return ((totalSuccess * 100) / (double) totalBuilds);
  }