Return true if type is of the given kind. A union type is of a given kind if all constituent types are of the given kind. An intersection type is of a given kind if at least one constituent type is of the given kind.
774171
function isTypeOfKind(type, kind) {
            if (type.flags & kind) {
                return true;
            }
            if (type.flags & 524288 /* Union */) {
                var types = type.types;
                for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
                    var t = types_14[_i];
                    if (!isTypeOfKind(t, kind)) {
                        return false;
                    }
                }
                return true;
            }
            if (type.flags & 1048576 /* Intersection */) {
                var types = type.types;
                for (var _a = 0, types_15 = types; _a < types_15.length; _a++) {
                    var t = types_15[_a];
                    if (isTypeOfKind(t, kind)) {
                        return true;
                    }
                }
            }
            return false;
        }
820418
def is_enum_type(type_):
    

    return isinstance(type_, type) and issubclass(type_, tuple(_get_types(Types.ENUM)))
1019630
public static boolean isSingleValueType(Class<?> type) {

        LettuceAssert.notNull(type, "Class must not be null!");

        return findDescriptor(type).map((descriptor) -> !descriptor.isMultiValue() && !descriptor.isNoValue()).orElse(false);
    }
811949
private static boolean isNestedTypeDependency(String type, List<TypeElement> nestedTypes,
            Map<String, String> mappedUniName, boolean isUniName) {
        if (nestedTypes == null) {
            return false;
        }

        for (TypeElement t : nestedTypes) {
            if (type.equals(t.name()) || type.equals(getProxyClassName(t.name(), mappedUniName, isUniName))) {
                return true;
            }
        }

        return false;
    }
43988
static boolean isSafeReturnType(Class<?> type) { 
        return !ConnectionPoolDataSource.class.isAssignableFrom(type)
               && !CommonDataSource.class.isAssignableFrom(type) 
               && !XADataSource.class.isAssignableFrom(type)
               && !DataSource.class.isAssignableFrom(type)
               && !PooledConnection.class.isAssignableFrom(type) // implies XAConnection
               && !Connection.class.isAssignableFrom(type)
               && !DatabaseMetaData.class.isAssignableFrom(type)
               && !Statement.class.isAssignableFrom(type) // implies prepared & callable
               && !ResultSet.class.isAssignableFrom(type)
               && !XAResource.class.isAssignableFrom(type);
    }
105565
protected boolean hasAllCanonicalTypes() {
        if (types.length==0) return false;
        for (String typeName : types) {
            InternalRelationType type = QueryUtil.getType(tx, typeName);
            if (type!=null && !type.isPropertyKey() && !type.multiplicity().isUnique(dir)) return false;
        }
        return true;
    }
1241708
public boolean isInterfaceOrUnion(Type type) {
        Optional<TypeDefinition> typeDefinition = getType(type);
        if (typeDefinition.isPresent()) {
            TypeDefinition definition = typeDefinition.get();
            return definition instanceof UnionTypeDefinition || definition instanceof InterfaceTypeDefinition;
        }
        return false;
    }
1145850
def type_inherits_of_type(inheriting_type, base_type):
    
    assert isinstance(inheriting_type, type) or isclass(inheriting_type)
    assert isinstance(base_type, type) or isclass(base_type)

    if inheriting_type == base_type:
        return True
    else:
        if len(inheriting_type.__bases__) != 1:
            return False
        return type_inherits_of_type(inheriting_type.__bases__[0], base_type)
1030400
protected function intersection(IType $type)
    {
        $intersectionTypes = [];

        foreach ($this->types as $key => $unionedType) {
            $intersection = $unionedType->intersect($type);
            if ($intersection) {
                $intersectionTypes[] = $intersection;
            }
        }

        return $intersectionTypes ? self::create($intersectionTypes) : null;
    }
1171605
function isType(o, typeName) {
        if (!o || !_.isObject(o)) {
            return false;
        }
        try {
            return Tinkerpop.Java.instanceOf(o, typeName);
        }
        catch (err) {
            return false;
        }
    }
184754
def is_union_type(tp):
    
    if NEW_TYPING:
        return (tp is Union or
                isinstance(tp, _GenericAlias) and tp.__origin__ is Union)
    return type(tp) is _Union
1002826
public static boolean isSameType(Type s, Type t, VisitorState state) {
    if (s == null || t == null) {
      return false;
    }
    Types types = state.getTypes();
    return types.isSameType(types.erasure(s), types.erasure(t));
  }
253227
def is_type_factory(_type):
    

    def inner(x):
        if type(x) != _type:
            raise ValueError("Value must have type '%s'" % str(_type))

    return inner
720325
public final boolean isAssignableFrom(SoyType srcType) {
    // Handle unions generically.  A type is assignable from a union if it is assignable from _all_
    // memebers.
    if (srcType instanceof UnionType) {
      // By construction union types are guaranteed
      // 1. not to be empty
      // 2. not to contain union types
      UnionType asUnion = (UnionType) srcType;
      for (SoyType member : asUnion.getMembers()) {
        if (!doIsAssignableFromNonUnionType(member)) {
          return false;
        }
      }
      return true;
    } else {
      return doIsAssignableFromNonUnionType(srcType);
    }
  }
1192952
public boolean isKindOf(final Type _type)
    {
        boolean ret = false;
        Type type = this;
        while (type != null && type.getId() != _type.getId()) {
            type = type.getParentType();
        }
        if (type != null && type.getId() == _type.getId()) {
            ret = true;
        }
        return ret;
    }
75348
def is_equal_type(type_a: GraphQLType, type_b: GraphQLType):
    """"""
    # Equivalent types are equal.
    if type_a is type_b:
        return True

    # If either type is non-null, the other must also be non-null.
    if is_non_null_type(type_a) and is_non_null_type(type_b):
        # noinspection PyUnresolvedReferences
        return is_equal_type(type_a.of_type, type_b.of_type)  # type:ignore

    # If either type is a list, the other must also be a list.
    if is_list_type(type_a) and is_list_type(type_b):
        # noinspection PyUnresolvedReferences
        return is_equal_type(type_a.of_type, type_b.of_type)  # type:ignore

    # Otherwise the types are not equal.
    return False
795756
public static boolean isIntType(Class<?> type) {
        return (type.isPrimitive() && type == int.class) || (type.isPrimitive() && type == long.class)
                || (!type.isPrimitive() && type == Integer.class) || (!type.isPrimitive() && type == Long.class);
    }