Returns true iff the two hits can be used to circularise the reference sequence of the hits
4984
def _can_circularise(self, start_hit, end_hit):
        ''''''
        if not(self._is_at_ref_start(start_hit) or self._is_at_ref_end(end_hit)):
            return False

        if self._is_at_qry_end(start_hit) \
          and self._is_at_qry_start(end_hit) \
          and start_hit.on_same_strand() \
          and end_hit.on_same_strand():
            return True

        if self._is_at_qry_start(start_hit) \
          and self._is_at_qry_end(end_hit) \
          and (not start_hit.on_same_strand()) \
          and (not end_hit.on_same_strand()):
            return True

        return False
155306
private static boolean multiPointRelateEnvelope_(MultiPoint multipoint_a,
			Envelope envelope_b, double tolerance, int relation,
			ProgressTracker progress_tracker) {
		switch (relation) {
		case Relation.disjoint:
			return multiPointDisjointEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.within:
			return multiPointWithinEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.contains:
			return multiPointContainsEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.equals:
			return multiPointEqualsEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.touches:
			return multiPointTouchesEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.crosses:
			return multiPointCrossesEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
192625
public final boolean isRecurring() {
        return recurrenceRule != null && !(recurrenceRule.get() == null) && !recurrenceRule.get().trim().equals(""); //$NON-NLS-1$
    }
339196
@JSONField(serialize = false)
    public boolean isSequential() {
        if (getList() != null) {
            for (Input.Obj obj : getList()) {
                if (obj.isSequential()) {
                    return true;
                }
            }
        }
        return false;
    }
852860
def circular_references(self) -> Set[str]:
        
        rval = set()
        for k in self.grammarelts.keys():
            if k in self.dependency_closure(k):
                rval.add(k)
        return rval
889288
function moveSequenceAfter(slotPrev, slotFirst, slotLast) {
                    slotFirst.prev.next = slotLast.next;
                    slotLast.next.prev = slotFirst.prev;

                    slotFirst.prev = slotPrev;
                    slotLast.next = slotPrev.next;

                    slotPrev.next = slotFirst;
                    slotLast.next.prev = slotLast;

                    return true;
                }
566516
def nucmer_hit_containing_reference_position(nucmer_hits, ref_name, ref_position, qry_name=None):
        ''''''
        for contig_name in nucmer_hits:
            for hit in nucmer_hits[contig_name]:
                if hit.ref_name == ref_name and (qry_name is None or qry_name == hit.qry_name) and hit.ref_coords().distance_to_point(ref_position) == 0:
                    return hit

        return None
767668
private boolean hasEagerSingletonBinding() {
    for (Key<?> key : bindings.keySet()) {
      GinScope scope = determineScope(key);
      if (GinScope.EAGER_SINGLETON.equals(scope)) {
        return true;
      }
    }

    return false;
  }
883159
def _get_longest_hit_at_qry_start(self, nucmer_hits):
        ''''''
        hits_at_start = [hit for hit in nucmer_hits if self._is_at_qry_start(hit)]
        return self._get_longest_hit_by_ref_length(hits_at_start)
720753
def is_cyclic(head):
    
    if not head:
        return False
    runner = head
    walker = head
    while runner.next and runner.next.next:
        runner = runner.next.next
        walker = walker.next
        if runner == walker:
            return True
    return False
1338745
public boolean hasPurgeableTombstones(int gcBefore)
    {
        for (int i = 0; i < size; i++)
        {
            if (delTimes[i] < gcBefore)
                return true;
        }
        return false;
    }
709175
def circularize(self):
        '''

        '''
        if self.top[-1].seq == '-' and self.bottom[0].seq == '-':
            raise ValueError('Cannot circularize - termini disconnected.')
        if self.bottom[-1].seq == '-' and self.top[0].seq == '-':
            raise ValueError('Cannot circularize - termini disconnected.')

        copy = self.copy()
        copy.circular = True
        copy.top.circular = True
        copy.bottom.circular = True
        return copy
992626
def _containing_contigs(self, hits):
        ''''''
        return {hit.ref_name for hit in hits if self._contains(hit)}
924042
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public static boolean hasJazzhandMultiFakeTouchFeature(Context context) {
        return hasJazzhandMultiFakeTouchFeature(context.getPackageManager());
    }
1342376
def _get_hit_nearest_ref_end(self, hits):
        ''''''
        nearest_to_end = hits[0]
        for hit in hits[1:]:
            if hit.ref_coords().end > nearest_to_end.ref_coords().end:
                nearest_to_end = hit
        return nearest_to_end
1254130
def _get_identical_contigs(self, hits_dict):
        ''''''
        equivalent_contigs = []

        for qry_name, containing in hits_dict.items():
            equivalent = set()
            for containing_name in containing:
                if containing_name in hits_dict and qry_name in hits_dict[containing_name]:
                    equivalent.add(containing_name)
                    equivalent.add(qry_name)

            if len(equivalent):
                equivalent_contigs.append(equivalent)
                equivalent_contigs = self._collapse_list_of_sets(equivalent_contigs)

        return equivalent_contigs
305004
protected function hasCircularReferences($parent, $visited = array()){
		foreach($parent->subqueries as $child){
			if(isset($visited[spl_object_hash($child)]))
				return true;
			$visited[spl_object_hash($child)] = true;
			if($this->hasCircularReferences($child, $visited))
				return true;
			array_pop($visited);
		}
		return false;
	}