overlap returns true when: as and bs have one or more elements in common,
as and bs are both null, or as and bs are both empty.
482079
public static boolean overlap(@Nullable String[] as, @Nullable String[] bs)
  {
    if (as == null || bs == null) {
      // They only have overlap if both are null.
      return as == null && bs == null;
    }
    if (as.length == 0 && bs.length == 0) {
      return true;
    }

    for (String a : as) {
      for (String b : bs) {
        if (Objects.equals(a, b)) {
          return true;
        }
      }
    }

    return false;
  }
747764
private static boolean nonEmptyIntersection(String[] a, String[] b) {
    if (a == null || b == null || a.length == 0 || b.length == 0) {
      return false;
    }
    for (String toFind : a) {
      if (contains(b, toFind)) {
        return true;
      }
    }
    return false;
  }
982304
public static boolean checkDuplicateElements(DMatrixSparseCSC A ) {
        A = A.copy(); // create a copy so that it doesn't modify A
        A.sortIndices(null);
        return !checkSortedFlag(A);
    }
187663
static boolean isBigger(Long a, Long b) {
        return a == null || (b != null && b > a);
    }
95426
def overlaps(self, box, th=0.0001):
        
        int_box = Box.intersection_box(self, box)
        small_box = self if self.smaller(box) else box
        return True if int_box.area() / small_box.area() >= th else False
903457
def slots_overlap(slot, other_slot):
    
    slot_ends_at = ends_at(slot)
    other_ends_at = ends_at(other_slot)
    if (slot.starts_at >= other_slot.starts_at and
        slot_ends_at <= other_ends_at
    ):
        return True
    if (other_slot.starts_at >= slot.starts_at and
        other_ends_at <= slot_ends_at
    ):
        return True
    return False
145612
def overlap(self, other):
        """"""
        if self._start < other.end and self._end > other.start:
            return True
        return False
1108002
def overlaps(self, contig, start, end, strand=None):
        
        return (
            self.can_overlap(contig, strand) and
            self.distance_to_interval(start, end) == 0)
686076
public static <T> boolean equal(T a, T b) {
        return a != null ? a.equals(b) : b == null;
    }
1011700
def overlaps(self, other):
        """"""
        if self > other:
            smaller, larger = other, self
        else:
            smaller, larger = self, other
        if larger.empty():
            return False
        if smaller._upper_value == larger._lower_value:
            return smaller._upper == smaller.CLOSED and larger._lower == smaller.CLOSED
        return larger._lower_value < smaller._upper_value
991983
public static boolean checkOverlap (Service s1, Service s2) {
        if (s1.calendar == null || s2.calendar == null) {
            return false;
        }
        // overlap exists if at least one day of week is shared by two calendars
        boolean overlappingDays = s1.calendar.monday == 1 && s2.calendar.monday == 1 ||
                s1.calendar.tuesday == 1 && s2.calendar.tuesday == 1 ||
                s1.calendar.wednesday == 1 && s2.calendar.wednesday == 1 ||
                s1.calendar.thursday == 1 && s2.calendar.thursday == 1 ||
                s1.calendar.friday == 1 && s2.calendar.friday == 1 ||
                s1.calendar.saturday == 1 && s2.calendar.saturday == 1 ||
                s1.calendar.sunday == 1 && s2.calendar.sunday == 1;
        return overlappingDays;
    }
932439
function overlapBounding(a, b) {
        var A_end_x = a[0] + a[2];
        var A_end_y = a[1] + a[3];
        var B_end_x = b[0] + b[2];
        var B_end_y = b[1] + b[3];

        if (
            a[0] > B_end_x ||
            a[1] > B_end_y ||
            A_end_x < b[0] ||
            A_end_y < b[1]
        ) {
            return false;
        }
        return true;
    }
593964
def overlaps_with(self, othermatch, strict=False):
        '''
        
        '''
        one = self.matches_entry(othermatch, strict)
        if strict:
            return one
        return one and othermatch.matches_entry(self, strict)
1085004
def code_almost_equal(a, b):
    
    split_a = split_and_strip_non_empty_lines(a)
    split_b = split_and_strip_non_empty_lines(b)

    if len(split_a) != len(split_b):
        return False

    for (index, _) in enumerate(split_a):
        if ''.join(split_a[index].split()) != ''.join(split_b[index].split()):
            return False

    return True
1143828
def ismatch(a,b):
    """"""
    #Try the easy case
    if a == b:
        return True
    else:
        #Try isinstance in both orders
        try:
            if isinstance(a,b):
                return True
        except TypeError:
            try:
                if isinstance(b,a):
                    return True
            except TypeError:
                #Try isinstance(a, type(b)) in both orders
                try:
                    if isinstance(a,type(b)):
                        return True
                except TypeError:
                    try:
                        if isinstance(b,type(a)):
                            return True
                    except TypeError:
                        #Try the string representation
                        if str(a).lower() == str(b).lower():
                            return True
                        else:
                            return False
245256
def interval_overlap(a, b, x, y):
    """"""
    if b <= x or a >= y:
        return 0
    elif x <= a <= y:
        return min(b, y) - a
    elif x <= b <= y:
        return b - max(a, x)
    elif a >= x and b <= y:
        return b - a
    else:
        assert False
34737
def overlaps(self,junc,tolerance=0):
    """"""
    if not self.left.overlaps(junc.left,padding=tolerance): return False
    if not self.right.overlaps(junc.right,padding=tolerance): return False
    return True