////////////////////////////////////////////////////////////////////////
// Other types
////////////////////////////////////////////////////////////////////////
171332
func checkAgainstBool(e bool, c reflect.Value) (err error) {
	if c.Kind() != reflect.Bool {
		err = NewFatalError("which is not a bool")
		return
	}

	err = errors.New("")
	if c.Bool() == e {
		err = nil
	}
	return
}
1205191
private void addNthLastOfType() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    count++;
                }
                
                n = DOMHelper.getNextSiblingElement(n);
            }
            
            if (specifier.isMatch(count)) {
                result.add(node);
            }
        }
    }
1031279
function(type, visible) {
			if (typeof type === "object") {
				this._visibleAnnotationTypes = type;
			} else {
				if (!this._visibleAnnotationTypes) this._visibleAnnotationTypes = {};
				this._visibleAnnotationTypes[type] = visible;
			}
		}
463720
public void setType(String type) {
    if(StringUtils.isBlank(type)) {
      setType(TYPE.UNSET);
    }
    else {
      if(TYPE.NEGATIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEGATIVE);
      }
      if(TYPE.NEUTRAL.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEUTRAL);
      }
      if(TYPE.POSITIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.POSITIVE);
      }
      if(TYPE.UNSET.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.UNSET);
      }
    }
  }
214401
public void beginType(String type, String kind, int modifiers) throws IOException {
    beginType(type, kind, modifiers, null);
  }
528200
function addTypeListener(emitter, type, event, listener) {
    if (!emitter._listeners) {
        emitter._listeners = {
            on: {},
            after: {},
            before: {}
        };
    }

    if (!emitter._listeners[type][event]) {
        emitter._listeners[type][event] = [];
    }
    if ('on' == type && emitter._listeners[type][event].length) {
        throw Error('Listener for event "' + event + '" already defined.');
    }

    emitter._listeners[type][event].push(listener);

    return function remove() {
        const index = emitter._listeners[type][event].indexOf(listener);
        if (-1 !== index) {
            emitter._listeners[type][event].splice(index, 1);
        }
    };
}
1000430
function checkType(type,value){
             if(type){
                 if(typeof type == 'string' && type != 'any' &&
                         (type == 'null' ? value !== null : typeof value != type) &&
                         !(value instanceof Array && type == 'array') &&
                         !(value instanceof Date && type == 'date') &&
                         !(type == 'integer' && value%1===0)){
                     return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
                 }
                 if(type instanceof Array){
                     var unionErrors=[];
                     for(var j = 0; j < type.length; j++){ // a union type
                         if(!(unionErrors=checkType(type[j],value)).length){
                             break;
                         }
                     }
                     if(unionErrors.length){
                         return unionErrors;
                     }
                 }else if(typeof type == 'object'){
                     var priorErrors = errors;
                     errors = [];
                     checkProp(value,type,path);
                     var theseErrors = errors;
                     errors = priorErrors;
                     return theseErrors;
                 }
             }
             return [];
         }
343442
function type(value) {
  let valueType = typeof value;
  if (Array.isArray(value)) {
    valueType = 'array';
  } else if (value instanceof Date) {
    valueType = 'date';
  } else if (value === null) {
    valueType = 'null';
  }

  return valueType;
}
619474
function (typeSpecs, values, location) {
	    checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
	  }
141632
function Type(opt) {
	CallableValue.call(this);
	this.opt = opt || {};
	this.isReaded = false;
	this.isWritten = false;
}
14712
private void addFirstOfType() {
		for (Node node : nodes) {
			Index index = helper.getIndexInParent(node, true);
			if (index.index == 0)
				result.add(node);
		}
	}
634276
function Tree(type) {
    abstractions.Composite.call(this, type);
    if (!utilities.types.isProcedural(type)) {
        throw new utilities.Exception({
            $module: '/bali/composites/Tree',
            $procedure: '$Tree',
            $exception: '$invalidParameter',
            $parameter: utilities.types.symbolForType(type),
            $text: '"An invalid tree type was passed to the constructor."'
        });
    }

    // the array is a private attribute so methods that use it are defined in the constructor
    const array = [];

    this.toArray = function() {
        return array.slice(); // copy the array
    };

    this.getSize = function() {
        return array.length;
    };

    this.addChild = function(child) {
        array.push(child);
        child.getParent = function() { return this; };
    };

    this.getChild = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        return array[index];
    };

    this.getParent = function() { };  // will be reset by parent when added as a child

    return this;
}
1187978
@ObjectiveCName("appendArrayGenericType:types:")
    public static void appendArrayGenericType(StringBuilder out, Type[] types) {
        if (types.length == 0) {
            return;
        }
        appendGenericType(out, types[0]);
        for (int i = 1; i < types.length; i++) {
            out.append(',');
            appendGenericType(out, types[i]);
        }
    }
986304
private void addType(Class<?> type, Object object)
    {
        if (!items.containsKey(type))
        {
            items.put(type, new HashSet<>());
        }
        items.get(type).add(object);
    }
1095576
function getNthElementOfType(context, element, index) {
  let nthOfType = 0;
  for (let i = 0, child; (child = context.children[i]); i++) {
    if (child.nodeType === child.ELEMENT_NODE &&
        child.tagName.toLowerCase() === element.tagName.toLowerCase()) {
      if (nthOfType === index) {
        return child;
      }
      nthOfType++;
    }
  }
  return null;
}
112322
void check_type() throws DevFailed
	{
		boolean unsuported = true;
		if (type == Tango_DEV_SHORT)
			unsuported = false;
		else if (type == Tango_DEV_USHORT)
			unsuported = false;
		else if (type == Tango_DEV_LONG)
			unsuported = false;
		else if (type == Tango_DEV_LONG64)
			unsuported = false;
		else if (type == Tango_DEV_ULONG)
			unsuported = false;
		else if (type == Tango_DEV_ULONG64)
			unsuported = false;
		else if (type == Tango_DEV_BOOLEAN)
			unsuported = false;
		else if (type == Tango_DEV_FLOAT)
			unsuported = false;
		else if (type == Tango_DEV_DOUBLE)
			unsuported = false;
		else if (type == Tango_DEV_STRING)
			unsuported = false;
		else if (type == Tango_DEV_STATE)
			unsuported = false;
		else if (type == Tango_DEV_ENCODED)
			unsuported = false;

		if (unsuported == true)
		{
			Util.out3.println("Attr.check_type throwing exception");
		
			StringBuffer o = new StringBuffer("Attribute : ");
			o.append(name).append(": Data type is not supported");
			Except.throw_exception("API_AttrWrongDefined",
				    o.toString(),
					"Attr.check_type");
		}
	}
169146
function maybe_type() {
  skip_horiz_white();
  if (look(/\{/)) {
    var tdf = typedef();
    current_tag["type"] = tdf["type"];
    current_tag["optional"] = tdf["optional"] ? true : false;
  }
}