Return `True` if type *a* subsumes type *b*.
176122
def subsumes(self, a, b):
        """"""
        return a == b or b in self.descendants(a)
670153
function(a, b)
{
    return (a.l <= b.r && b.l <= a.r && a.b <= b.t && b.b <= a.t);
}
195171
def resolve(self, other: Type) -> Optional[Type]:
        """"""
        if not isinstance(other, NltkComplexType):
            return None
        if not isinstance(other.second, NltkComplexType):
            return None
        other_first = other.first.resolve(other.second.first)
        if other_first is None:
            return None
        other_first = other_first.resolve(other.second.second)
        if not other_first:
            return None
        other_second = other.second.resolve(ComplexType(other_first, other_first))
        if not other_second:
            return None
        return BinaryOpType(other_first, self._allowed_substitutions, self._signature)
719864
def _handle_type(self, other):
        """"""
        if isinstance(other, Int):
            return Int
        elif isinstance(other, Float):
            return Float
        else:
            raise TypeError(
                f"Unsuported operation between `{type(self)}` and `{type(other)}`."
            )
130651
def isDescendantOf(self, other):
    '''

    '''
    if isinstance(other, Key):
      return other.isAncestorOf(self)
    raise TypeError('%s is not of type %s' % (other, Key))
151016
def _merge_a_into_b(self, a, b):
        
        from easydict import EasyDict as edict
        if type(a) is not edict:
            return

        for k, v in a.items():
            # a must specify keys that are in b
            if k not in b:
                raise KeyError('{} is not a valid config key'.format(k))

            # the types must match, too
            old_type = type(b[k])
            if old_type is not type(v):
                if isinstance(b[k], np.ndarray):
                    v = np.array(v, dtype=b[k].dtype)
                else:
                    raise ValueError(('Type mismatch ({} vs. {}) '
                                      'for config key: {}').format(type(b[k]),
                                                                   type(v), k))

            # recursively merge dicts
            if type(v) is edict:
                try:
                    self._merge_a_into_b(a[k], b[k])
                except:
                    print('Error under config key: {}'.format(k))
                    raise
            else:
                b[k] = v
        return b
90477
def assertSameType(a, b):
    
    if not isinstance(b, type(a)):
        raise NotImplementedError("This operation is only supported for " \
            "elements of the same type. Instead found {} and {}".
                format(type(a), type(b)))
1189481
def _issubclass(sub, sup):
    '''
    '''
    if sup is not object:
        try:
            return issubclass(sub, sup)
        except TypeError:
            pass
    return False
1326503
def is_type(type_, *p):
    
    try:
        for i in p:
            if i.type_ != type_:
                return False

        return True
    except:
        pass

    return False
624669
def match(self, other):
        
        if self.sub_type != '*' and other.sub_type != '*' and other.sub_type != self.sub_type:
            return False

        if self.main_type != '*' and other.main_type != '*' and other.main_type != self.main_type:
            return False

        return True
588063
public boolean isSubclassOf(TypeElement t1, TypeElement t2) {
        return typeUtils.isSubtype(t1.asType(), t2.asType());
    }
1200711
public static boolean isSubtype(Type s, Type t, VisitorState state) {
    if (s == null || t == null) {
      return false;
    }
    if (SUBTYPE_UNDEFINED.contains(s.getTag()) || SUBTYPE_UNDEFINED.contains(t.getTag())) {
      return false;
    }
    Types types = state.getTypes();
    return types.isSubtype(types.erasure(s), types.erasure(t));
  }
68663
def is_entailed_by(self, other):
        
        if not set(self.include.keys()).issubset(set(other.include.keys())):
            return False
        if not self.exclude.isuperset(other.exclude):
            return False
        if not self.prototype.is_entailed_by(other.prototype):
            return False
        return True
925045
public static <T> boolean gt(Comparable<T> a, T b)
	{
		return gt(a.compareTo(b));
	}
501552
private void checkOperand(Type type, Expr operand, Environment environment) {
		checkIsSubtype(type, checkExpression(operand, environment), environment, operand);
	}
899487
function(a, b)
{
    return (a.bb_l <= b.bb_r && b.bb_l <= a.bb_r && a.bb_b <= b.bb_t && b.bb_b <= a.bb_t);
}
653441
def assert_type_equivalent(o1, o2):
    '''
    '''
    assert o1 == o2
    assert o2 == o1
    assert type(o1) is type(o2)