Make a kind out of a possible shorthand. If the given
        argument is a sequence of types or a singular type, it becomes
        a kind that accepts exactly those types. If the given argument
        is None, it becomes a type that accepts anything.
354347
def normalize_kind(self, kindlike):
        
        if kindlike is None:
            return (object,)
        elif isinstance(kindlike, type):
            return (kindlike,)
        else:
            return tuple(kindlike)
1163629
function(type){
            type = this.string(type);
            if(types.indexOf(type.toLowerCase()) < 0){
                throw new TypeError('a type in [' + types.join(', ') + '] is expected, but ' + type + ' given');
            }
            return type.toLowerCase();
        }
1307422
private Token[] match(Token.Kind... kinds) {
		Token[] result = new Token[kinds.length];
		for (int i = 0; i != result.length; ++i) {
			checkNotEof();
			Token token = tokens.get(index++);
			if (token.kind == kinds[i]) {
				result[i] = token;
			} else {
				syntaxError("Expected \"" + kinds[i] + "\" here", token);
			}
		}
		return result;
	}
67022
def make(name):
    """"""
    __all__.append(name)
    return type(name if py3k else name.encode("utf8"), (Token,), {})
1363390
def p_SingleType_any(p):
  """"""
  p[0] = helper.unwrapTypeSuffix(model.SimpleType(
    model.SimpleType.ANY), p[2])
190285
function composeS(...args) {
  if(!arguments.length) {
    throw new TypeError(err)
  }

  const ms =
    args.slice().reverse()

  const head =
    ms[0]

  if(!isSemigroupoid(head)) {
    throw new TypeError(err)
  }

  if(ms.length === 1) {
    return head
  }

  return ms.slice().reduce((comp, m) => {
    if(!isSameType(comp, m)) {
      throw new TypeError(err)
    }

    return comp.compose(m)
  })
}
920058
def attempt(self, *kinds):
        """"""
        if self._error:
            raise self._error
        token = self.next_token
        if not token:
            return None
        if kinds and token.kind not in kinds:
            return None
        self._advance()
        return token
194610
private static Class<?>[] convertArgumentTypesToPrimitive(Class<?>[] paramTypes, Object[] arguments) {
        Class<?>[] types = new Class<?>[arguments.length];
        for (int i = 0; i < arguments.length; i++) {
            Class<?> argumentType = null;
            if (arguments[i] == null) {
                argumentType = paramTypes[i];
            } else {
                argumentType = getType(arguments[i]);
            }
            Class<?> primitiveWrapperType = PrimitiveWrapper.getPrimitiveFromWrapperType(argumentType);
            if (primitiveWrapperType == null) {
                types[i] = argumentType;
            } else {
                types[i] = primitiveWrapperType;
            }
        }
        return types;
    }
1171605
function isType(o, typeName) {
        if (!o || !_.isObject(o)) {
            return false;
        }
        try {
            return Tinkerpop.Java.instanceOf(o, typeName);
        }
        catch (err) {
            return false;
        }
    }
237528
function makeMaybe(inValues, makeChildType) {


	var maybeUniverse = new is.In(inValues);

	function Maybe(values) {

		// Maybe has two sub-sets:
		// - `.range` - Selects the non-enum values. Ex: `GreaterThan(3)`
		// - `.enum` - Selects the enum values. This is ALWAYS an `In`. Ex: `In([null])`.
		// Maybe is effectively an OR with these two properties.
		var result = splitByRangeAndEnum(maybeUniverse, values.range);
		this.range = result.range || set.EMPTY;
		if (values.enum) {
			if (result.enum !== set.EMPTY) {
				this.enum = set.union(result.enum, values.enum);
			} else {
				this.enum = values.enum;
			}
		} else {
			this.enum = result.enum;
		}
		if(this.enum === set.EMPTY && this.range === set.EMPTY) {
			return set.EMPTY;
		}
	}
	Maybe.prototype.orValues = function() {
		var values = [];
		if( this.range !== set.EMPTY ) {
			values.push(this.range);
		}
		if( this.enum !== set.EMPTY ) {
			values.push(this.enum);
		}
		return values;
	};
	Maybe.prototype[isMemberSymbol] = function isMember() {
		var rangeIsMember = this.range[isMemberSymbol] || this.range.isMember,
			enumIsMember = this.enum[isMemberSymbol] || this.enum.isMember;
		return rangeIsMember.apply(this.range, arguments) || enumIsMember.apply(this.enum, arguments);
	}



	set.defineComparison(Maybe, Maybe, {
		union: function(maybeA, maybeB) {
			var enumSet = set.union(maybeA.enum, maybeB.enum);
			var range = set.union(maybeA.range, maybeB.range);

			return new Maybe({
				enum: enumSet,
				range: range
			});
		},
		difference: function(maybeA, maybeB) {
			var enumSet = set.difference(maybeA.enum, maybeB.enum);
			var range = set.difference(maybeA.range, maybeB.range);

			return new Maybe({
				enum: enumSet,
				range: range
			});
		},
		intersection: function(maybeA, maybeB) {
			var enumSet = set.intersection(maybeA.enum, maybeB.enum);
			var range = set.intersection(maybeA.range, maybeB.range);

			return new Maybe({
				enum: enumSet,
				range: range
			});
		}
	});
	Maybe.inValues = inValues;

	set.defineComparison(set.UNIVERSAL, Maybe, {
		difference: function(universe, maybe) {
			var primary,
				secondary;

			if (maybe.range === set.UNIVERSAL) {
				// there is only the enum
				return new Maybe({
					range: maybe.range,
					enum: set.difference(maybeUniverse, maybe.enum)
				});
			}
			// there is only a primary
			if (maybe.enum === set.EMPTY) {
				var rangeSet = set.difference(set.UNIVERSAL, maybe.range);
				var notPresent = set.difference(maybeUniverse, maybe.range);
				// make sure they are included
				var enumSet = set.difference(notPresent, rangeSet);


				return new Maybe({
					range: rangeSet,
					enum: enumSet
				});
				// check enum things that aren't included in primary

			} else {
				primary = set.difference(universe, maybe.range);
				secondary = set.difference(maybeUniverse, maybe.enum);
			}
			return new Maybe({
				enum: secondary,
				range: primary
			});
		}
	});
	makeChildType = makeChildType || function(v) {
		return v;
	}

	Maybe.hydrate = function(value, childHydrate) {
		return new Maybe({
			range: childHydrate(value, makeChildType)
		});
	};

	return Maybe;
}
1125639
function prepareTypesArg (types) {
  if (Array.isArray(types)) {
    return types
  }
  if (types instanceof String) {
    types += ''
  }
  if (typeof types === 'string') {
    return types.trim().split(' ').filter(Boolean)
  }
  return [types]
}
205135
def instance_of(klass, arg):
    """"""
    if not isinstance(arg, klass):
        raise com.IbisTypeError(
            'Given argument with type {} is not an instance of {}'.format(
                type(arg), klass
            )
        )
    return arg
1255113
function from(arg, encodingOrOffset, length) {
  if (typeof arg === 'number') {
    throw new TypeError('Argument must not be a number')
  }
  return Buffer(arg, encodingOrOffset, length)
}
361268
function isPrimitive(type) {
	return (type === String || type === Number || type === Boolean || type === Symbol);
}
1261426
def of_type(cls, iterable, types):
    

    return cls(x for x in iterable if isinstance(x, types))
521784
public static TypeMirror normalizeType(TypeKind kind)
    {
        switch (kind)
        {
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case SHORT:
            case INT:
            case LONG:
            case FLOAT:
            case DOUBLE:
                return Typ.getPrimitiveType(kind);
            case DECLARED:
            case TYPEVAR:
            case ARRAY:
                return El.getTypeElement("java.lang.Object").asType();
            case VOID:
                return Typ.Void;
            default:
                throw new IllegalArgumentException(kind+" not valid");
        }
    }
1345984
function kindOf(val) {
        if (val === null) {
            return 'Null';
        } else if (val === UNDEF) {
            return 'Undefined';
        } else {
            return _rKind.exec( _toString.call(val) )[1];
        }
    }