Returns whether the replacement type is a templatized type which contains the current type.
e.g. current type T is being replaced with Foo<T>
559248
private boolean isRecursive(TemplateType currentType, JSType replacementType) {
    TemplatizedType replacementTemplatizedType =
        replacementType.restrictByNotNullOrUndefined().toMaybeTemplatizedType();
    if (replacementTemplatizedType == null) {
      return false;
    }

    Iterable<JSType> replacementTemplateTypes = replacementTemplatizedType.getTemplateTypes();
    for (JSType replacementTemplateType : replacementTemplateTypes) {
      if (replacementTemplateType.isTemplateType()
          && isSameType(currentType, replacementTemplateType.toMaybeTemplateType())) {
        return true;
      }
    }

    return false;
  }
733911
def match_type_by_name(expected_type, actual_type):
        
        if expected_type == None:
            return True
        if actual_type == None:
            raise Exception("Actual type cannot be null")
        
        expected_type = expected_type.lower()

        if actual_type.__name__.lower() == expected_type: 
            return True
        elif expected_type == "object":
            return True
        elif expected_type == "int" or expected_type == "integer":
            return issubclass(actual_type, int) #or issubclass(actual_type, long)
        elif expected_type == "long":
            return issubclass(actual_type, int)
        elif expected_type == "float" or expected_type == "double":
            return issubclass(actual_type, float)
        elif expected_type == "string":
            return issubclass(actual_type, str) #or issubclass(actual_type, unicode)
        elif expected_type == "bool" or expected_type == "boolean":
            return issubclass(actual_type, bool)
        elif expected_type == "date" or expected_type == "datetime":
            return issubclass(actual_type, datetime.datetime) or issubclass(actual_type. datetime.date)
        elif expected_type == "timespan" or expected_type == "duration":
            return issubclass(actual_type, int) or issubclass(actual_type, float)
        elif expected_type == "enum":
            return issubclass(actual_type, str) or issubclass(actual_type, int)
        elif expected_type == "map" or expected_type == "dict" or expected_type == "dictionary":
            return issubclass(actual_type, dict)
        elif expected_type == "array" or expected_type == "list":
            return issubclass(actual_type, list) or issubclass(actual_type, tuple) or issubclass(actual_type, set)
        elif expected_type.endswith("[]"):
            # Todo: Check subtype
            return issubclass(actual_type, list) or issubclass(actual_type, tuple) or issubclass(actual_type, set)
        else:
            return False
23932
public boolean canBeInObjStm() {
        switch (type) {
            case NULL:
            case BOOLEAN:
            case NUMBER:
            case STRING:
            case NAME:
            case ARRAY:
            case DICTIONARY:
                return true;
            case STREAM:
            case INDIRECT:
            default:
                return false;
        }
    }
1271006
def same_type(t1, t2):
    
    if isinstance(t1, string_type) and isinstance(t2, string_type):
        return True

    return type(t1) == type(t2)
759565
def match_type(mtype, patterns):
    ''''''
    for p in patterns:
        if fnmatch.fnmatch(mtype, p):
            return True
    return False
1200816
@Override
    public boolean containsTerm(Term t) {
        List<Term> terms = getTerms();
        for (int i = 0; i < terms.size(); i++) {
            Term t2 = terms.get(i);
            if (t2.equals(t))
                return true;
        }
        return false;
    }
1301843
private boolean verifyTypes()
    {
        SuccessAndResult<ThriftType> output = topologicalSort(thriftTypes, new Predicate<ThriftType>()
        {
            @Override
            public boolean apply(@Nullable ThriftType t)
            {
                ThriftProtocolType proto = checkNotNull(t).getProtocolType();
                if (proto == ThriftProtocolType.ENUM || proto == ThriftProtocolType.STRUCT) {
                    return verifyStruct(t, true);
                } else {
                    Preconditions.checkState(false, "Top-level non-enum and non-struct?");
                    return false;   // silence compiler
                }
            }
        });
        if (output.success) {
            thriftTypes = output.result;
            return true;
        } else {
            for (ThriftType t: output.result) {
                // we know it's gonna fail, we just want the precise error message
                verifyStruct(t, false);
            }
            return false;
        }
    }
1044532
def is_elementary_type(elem_type):
        
        if not oh.is_type(elem_type, bt.XmrType):
            return False
        if oh.is_type(elem_type, (bt.UVarintType, bt.IntType, mt.UnicodeType)):
            return True
        return False
328051
def is_fundamental(type_):
    """"""
    return does_match_definition(
        type_,
        cpptypes.fundamental_t,
        (cpptypes.const_t, cpptypes.volatile_t)) \
        or does_match_definition(
            type_,
            cpptypes.fundamental_t,
            (cpptypes.volatile_t, cpptypes.const_t))
573478
public boolean recordThisType(JSTypeExpression type) {
    if (type != null && !hasAnySingletonTypeTags() &&
        !currentInfo.hasThisType()) {
      currentInfo.setThisType(type);
      populated = true;
      return true;
    } else {
      return false;
    }
  }
323820
def _is_list_iter(self):
        

        # Check for literal or memory list.
        iter_var_type = (
            self.context.vars.get(self.stmt.iter.id).typ
            if isinstance(self.stmt.iter, ast.Name)
            else None
        )
        if isinstance(self.stmt.iter, ast.List) or isinstance(iter_var_type, ListType):
            return True

        # Check for storage list.
        if isinstance(self.stmt.iter, ast.Attribute):
            iter_var_type = self.context.globals.get(self.stmt.iter.attr)
            if iter_var_type and isinstance(iter_var_type.typ, ListType):
                return True

        return False
522168
public static boolean isSupportedJDKType(TypeName typeName) {
		if (typeName.isPrimitive()) {
			return getPrimitiveTransform(typeName) != null;
		}

		String name = typeName.toString();

		if (name.startsWith("java.lang")) {
			return getLanguageTransform(typeName) != null;
		}

		if (name.startsWith("java.util")) {
			return getUtilTransform(typeName) != null;
		}

		if (name.startsWith("java.math")) {
			return getMathTransform(typeName) != null;
		}

		if (name.startsWith("java.net")) {
			return getNetTransform(typeName) != null;
		}

		if (name.startsWith("java.sql")) {
			return getSqlTransform(typeName) != null;
		}

		return false;
	}
10505
public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(TypeDescription type) {
        return isSetter(is(type));
    }
255531
function cachedTypeDetector(type) {
	if (!cache.has(type)) {
		cache.set(type, (input) => isType(type, input) || typeInAncestry(type, input));
	}

	return cache.get(type);
}
681729
public static boolean isPrimitiveLike(Type t)
  {
    if(isNumber(t)) {
      return true;
    }
    if(isBoolean(t)) {
      return true;
    }
    if(isEnum(t)) {
      return true;
    }
    if(isCharacter(t)) {
      return true;
    }
    if(isDate(t)) {
      return true;
    }
    if(t == String.class) {
      return true;
    }
    return false;
  }
116913
public static boolean isConcrete(Type t)
  {
    if(t instanceof Class) {
      final Class<?> c = (Class<?>)t;
      return !c.isInterface() && !Modifier.isAbstract(c.getModifiers());
    }

    if(t instanceof ParameterizedType) {
      final ParameterizedType p = (ParameterizedType)t;
      return isConcrete(p.getRawType());
    }

    return false;
  }
207336
static boolean isSingleton(Types types, TypeElement element) {
    return isSingleton(types, element, element.asType());
  }