Returns True iff the values in this list can be entailed by the other
        list (ie, this list is a prefix of the other)
166463
def is_entailed_by(self, other):
        
        other = ListCell.coerce(other)
        if other.size() < self.size():
            # other is bigger, can't be entailed
            return False
        if self.value is None:
            # list is empty
            return True

        # see if any values in the shorter list are contradictory or 
        # unequal
        for i, oval in enumerate(other.value):
            if i == len(self.value):
                break

            if hasattr(self.value[i], 'is_entailed_by') and \
                   not self.value[i].is_entailed_by(oval):
                # compare cells
                return False 
            elif self.value[i] != oval:
                return False 
        return True
438457
def Contains(self, other):
        
        if other is None:
            raise ValueError("other is None.")

        if isinstance(other, Range):
            if other.low >= self.low and other.high <= self.high:
                return True
            return False
        else:
            return self.Contains(Range(other, other))
784282
def merge(self, other):
        
        other = BoolCell.coerce(other)
        if self.is_equal(other):
            # pick among dependencies
            return self
        elif other.is_entailed_by(self):
            return self
        elif self.is_entailed_by(other):
            self.value = other.value
        elif self.is_contradictory(other):
            raise Contradiction("Cannot merge T and F")
        else:
            raise Exception
        return self
207094
public boolean isSingleTable() {
        Collection<String> tableNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
        for (Table each : tables) {
            tableNames.add(each.getName());
        }
        return 1 == tableNames.size();
    }
826112
def is_in(allowed_values  # type: Set
          ):
    
    def is_in_allowed_values(x):
        if x in allowed_values:
            return True
        else:
            # raise Failure('is_in: x in ' + str(allowed_values) + ' does not hold for x=' + str(x))
            raise NotInAllowedValues(wrong_value=x, allowed_values=allowed_values)

    is_in_allowed_values.__name__ = 'is_in_{}'.format(allowed_values)
    return is_in_allowed_values
175092
def is_disjoint(self,other):
        
        if self.is_empty() or other.is_empty():
            return True

        if self.bounds[0] < other.bounds[0]:
            i1,i2 = self,other
        elif self.bounds[0] > other.bounds[0]:
            i2,i1 = self,other
        else:
            #coincident lower bounds
            if self.is_discrete() and not other.included[0]:
                return True
            elif other.is_discrete() and not self.included[0]:
                return True
            else:
                return False

        return not i2.bounds[0] in i1
1258870
def is_equal(self, other):
        
        other = StringCell.coerce(other)
        empties = [None,'']
        if self.value in empties and other.value in empties:
            return True
        return self.value == other.value
461300
def entails(self, other):
        
        other = BoolCell.coerce(other)
        return other.is_entailed_by(self)
165784
def overlap(listA, listB):
    
    if (listA is None) or (listB is None):
        return []
    else:
        return list(set(listA) & set(listB))
449279
public boolean inList(String path) {
    if (Strings.isNullOrEmpty(path)) {
      return false;
    }

    for (String prefix : mInnerList) {
      if (path.startsWith(prefix)) {
        return true;
      }
    }

    return false;
  }
1305788
private static boolean startsWith(List<?> list, List<?> other) {
    return list.size() >= other.size() && list.subList(0, other.size()).equals(other);
  }
633064
public boolean intersectsWith(Range other) {
        return !other.isEmpty() && !this.isEmpty() &&
                (this.contains(other.lower) || other.contains(this.lower)
                        || (other.upper > upper && other.lower < lower));
    }
1216806
def contains(self, other):
        
        return (self.left <= other.left and
                self.right >= other.right and
                self.top >= other.top and
                self.bottom <= other.bottom)
145612
def overlap(self, other):
        """"""
        if self._start < other.end and self._end > other.start:
            return True
        return False
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
64971
def IsSubset(self, other):
        """"""
        for val, freq in self.Items():
            if freq > other.Freq(val):
                return False
        return True
299039
function isValueInList(list, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i] == value) {
            return true;
        }
    }
    return false;
}