by construction, we know if our keytype
333351
@SuppressWarnings("unchecked") // is memcmp-able and uses the trie
  public int getPartition(K key, V value, int numPartitions) {
    return partitions.findPartition(key);
  }
283018
def ensureKeysAreSetup(self):
        
        if not areKeysSetup(self.name, self.keys_dir):
            raise REx(REx.reason.format(self.name) + self.keygenScript)
228761
private void typeCheck(K key) {
        Class<?> keyClass = key.getClass();
        if (keyClass != keyType && keyClass.getSuperclass() != keyType)
            throw new ClassCastException(keyClass + " != " + keyType);
    }
1348043
private boolean checkForMapKey(TabularType pType) {
        List<String> indexNames = pType.getIndexNames();
        return
                // Single index named "key"
                indexNames.size() == 1 && indexNames.contains(TD_KEY_KEY) &&
                // Only convert to map for simple types for all others use normal conversion. See #105 for details.
                pType.getRowType().getType(TD_KEY_KEY) instanceof SimpleType;
    }
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;
        }
    }
97013
private static StructrTypeDefinition determineType(final StructrSchemaDefinition root, final String name, final Map<String, Object> source) {

		if (source.containsKey(JsonSchema.KEY_RELATIONSHIP)) {

			final StructrRelationshipTypeDefinition def = new StructrRelationshipTypeDefinition(root, name);
			def.deserialize(source);

			return def;

		} else {

			final StructrNodeTypeDefinition def = new StructrNodeTypeDefinition(root, name);
			def.deserialize(source);

			return def;
		}
	}
905312
function validateIdenticialTypedKeys (keyA, keyB) {
    if (keyA && typeof keyA === 'string' && keyB && typeof keyB === 'string') {
        const keyA_CNS = (keyA.charAt(0) === COMPOSITEKEY_NS);
        const keyB_CNS = (keyB.charAt(0) === COMPOSITEKEY_NS);
        if (keyA_CNS !== keyB_CNS) {
            throw new Error(`Keys are not of the same type (composite or simple) [${keyA}] [${keyB}]`);
        }
    }
}
996385
def is_metatype(rdtype):
    """"""

    if rdtype >= TKEY and rdtype <= ANY or rdtype in _metatypes:
        return True
    return False
1316377
def do_build(self):
        
        tmp = self.explicit
        self.explicit = True
        b = super(KeyShareEntry, self).do_build()
        self.explicit = tmp
        return b
1177361
def IsPrimitiveType(obj):
   """"""
   return (isinstance(obj, types.bool) or isinstance(obj, types.byte) or
      isinstance(obj, types.short) or isinstance(obj, six.integer_types) or
      isinstance(obj, types.double) or isinstance(obj, types.float) or
      isinstance(obj, six.string_types) or
      isinstance(obj, types.PropertyPath) or
      isinstance(obj, types.ManagedMethod) or
      isinstance(obj, types.datetime) or
      isinstance(obj, types.URI) or isinstance(obj, type))
449293
def is_ready(self, key):
        """"""
        if self.pending_callbacks is None or key not in self.pending_callbacks:
            raise UnknownKeyError("key %r is not pending" % (key,))
        return key in self.results
255596
private boolean checkSupertypes(Class<?> cls) {
    for(Class<?> c : knownParameterizables) {
      if(c.isAssignableFrom(cls)) {
        return true;
      }
    }
    return false;
  }
169146
function maybe_type() {
  skip_horiz_white();
  if (look(/\{/)) {
    var tdf = typedef();
    current_tag["type"] = tdf["type"];
    current_tag["optional"] = tdf["optional"] ? true : false;
  }
}
802321
function isAbstractConstructorType(type) {
            if (type.flags & 2097152 /* Anonymous */) {
                var symbol = type.symbol;
                if (symbol && symbol.flags & 32 /* Class */) {
                    var declaration = getClassLikeDeclarationOfSymbol(symbol);
                    if (declaration && declaration.flags & 128 /* Abstract */) {
                        return true;
                    }
                }
            }
            return false;
        }
493364
private static boolean isConstantType(Type symbolType) {
		return symbolType.isPrimitive() || symbolType.is("java.lang.String") ||  symbolType.is("java.lang.Byte") ||
				symbolType.is("java.lang.Character") ||
				symbolType.is("java.lang.Short") ||
				symbolType.is("java.lang.Integer") ||
				symbolType.is("java.lang.Long") ||
				symbolType.is("java.lang.Float") ||
				symbolType.is("java.lang.Double") ||
				symbolType.is("java.lang.Boolean");
	}
361815
function isPreBuilt(indexObj, preBuiltPath) {
  if (!(indexObj.isDevelopingAddon && indexObj.isDevelopingAddon()) && fs.existsSync(preBuiltPath)) {
    return true;
  }
  return false;
}
88057
public static boolean isAllowedKeyType(SoyType type) {
    switch (type.getKind()) {
      case BOOL:
      case INT:
      case FLOAT:
      case STRING:
      case PROTO_ENUM:
        return true;
      default:
        return type == SoyTypes.NUMBER_TYPE;
    }
  }