They've done studies, you know. 50% of the time,
    it works every time.
335115
def sometimes(fn):
    

    def wrapped(*args, **kwargs):
        wrapped.x += 1
        if wrapped.x % 2 == 1:
            return fn(*args, **kwargs)

    wrapped.x = 0
    return wrapped
127962
def success_rate(self):
        
        if self.successes + self.fails == 0:
            success_rate = 0
        else:
            total_attempts = self.successes + self.fails
            success_rate = (self.successes * 100 / total_attempts)

        return success_rate
629467
def outstanding(self):
        """"""
        # Allow the same WorkItem to be yielded multiple times but not
        # count towards blocking the barrier.
        done_count = 0
        for item in self:
            if not self.wait_any and item.fire_and_forget:
                # Only count fire_and_forget items as done if this is
                # *not* a WaitAny barrier. We only want to return control
                # to the caller when at least one of the blocking items
                # has completed.
                done_count += 1
            elif item.done:
                done_count += 1

        if self.wait_any and done_count > 0:
            return False

        if done_count == len(self):
            return False

        return True
787781
def _succeed(self, result):
        

        for fn, args, kwargs in self._callbacks:
            fn(result, *args, **kwargs)
        self._resulted_in = result
499926
def satisfied(self,lab):
        
        for const in self.constraints:
            if not const.satisfied(lab):
                return False
        return True
1066546
public function hasPassed()
    {
        if($this->passed == false || $this->failed == true)
        {
            $this->passed = true;
            $this->failed = false;
        }
    }
718078
def is_success(self):
        '''   '''
        for _session in self._sessions.values():
            if not _session.is_success():
                return False
        return True
1171228
def _is_consistent(pairs, common, clus_seen, loci_similarity):
    
    all_true1 = all([all([common and loci_similarity[(p, c)] > parameters.similar  for p in pairs if (p, c) in loci_similarity]) for c in clus_seen])
    all_true2 = all([all([common and loci_similarity[(c, p)] > parameters.similar  for p in pairs if (c, p) in loci_similarity]) for c in clus_seen])
    return all_true1 * all_true2
125230
def still_optimizing(self):
        """"""

        # Check if we need to give up on optimizing.
        if (self.iterations > self.max_iter) or (self.time_elapsed() > self.max_time):
            return False

        # Always optimize for at least 'min_iter' iterations.
        elif not hasattr(self, 'improvement') or (self.iterations < self.min_iter):
            return True

        # Check convergence.
        else:
            self.converged = self.improvement < self.tol
            return False if self.converged else True
586093
boolean corralIfNeeded(Collection<Unit> working) {
        if (isRecoverable()
                && si.corralled() != null) {
            activeGuts = si.corralled();
            setWrap(working, working);
            return isAttemptingCorral = true;
        }
        return isAttemptingCorral = false;
    }
672452
def _work(self):
        """"""
        super(HyperVNeutronAgent, self)._work()
        if self._nvgre_enabled:
            self._nvgre_ops.refresh_nvgre_records()
        self._port_enable_control_metrics()
1090028
def do_work
      done = false

      while not done
        queue_runner(@concurrency, @delay, @retry_count, @progress)

        if @interactive and @verify
          done = verify_results(@group)
          # a retry means we are not done yet.
          done = false if done == 'retry'
        else
          done = true
        end
      end

      if not @verify
        failed_workers, results_display = get_results(group)
        exit 1 if failed_workers.size > 0
      end

      puts 'chimp run complete'
    end
1315451
def success(m)
      puts _word_wrap(m, '# ').green
      @targets.each { |_, t| t.success(m) }
    end
1217817
function () {
		var series = this.series,
			i = series.length;
		if (!this.isXAxis) {
			while (i--) {
				series[i].setStackedPoints();
			}
			// Loop up again to compute percent stack
			if (this.usePercentage) {
				for (i = 0; i < series.length; i++) {
					series[i].setPercentStacks();
				}
			}
		}
	}
661614
function () {
        if (job.pull_requests < worker_count) {
            return false;
        }
        for (var i = 0; i < worker_count; i++) {
            if (!job.worker_complete[i]) {
                return false;
            }
        }
        return true;
    }
875322
def work
      success, val, reason = SafeTaskExecutor.new(@task).execute(*@args)
      complete(success, val, reason)
    end
817227
def submission_successful(self, participant):
        """"""
        num_approved = len(Participant.query.filter_by(status="approved").all())
        current_generation = participant.nodes()[0].generation
        if (
            num_approved % self.generation_size == 0
            and (current_generation % 10 + 1) == 0
        ):
            for e in self.models.RogersEnvironment.query.all():
                e.step()