Check data type and call super to remove data - synchronized in super
504839
public boolean remove(SpdData data) {
        if (data == null)
            return false;
        if (data instanceof SpdStat) {
            return super.remove(data);
        } else {
            return false;
        }
    }
865537
@Check(CheckType.FAST)
	public void checkSuperType(SarlEvent event) {
		checkSuperTypes(
				event,
				SARL_EVENT__EXTENDS,
				Utils.singletonList(event.getExtends()),
				Event.class,
				false);
	}
627973
private static Data checkData(final Data data) {
		if (Data.EMPTY.equals(data)) {
			throw new IllegalStateException("Argument 'data' must not be empty.");
		}
		return data;
	}
796376
def check_sub_type_without(val, delim)
      return false unless val =~ delim
      new_val = val.gsub(delim, "").strip
      NodeCache.find(attributes["type"]) == new_valu
    end
1181017
public void setExtends(String superType) {
		if (!Strings.isEmpty(superType)
				&& !Behavior.class.getName().equals(superType)) {
			JvmParameterizedTypeReference superTypeRef = newTypeRef(this.sarlBehavior, superType);
			JvmTypeReference baseTypeRef = findType(this.sarlBehavior, Behavior.class.getCanonicalName());
			if (isSubTypeOf(this.sarlBehavior, superTypeRef, baseTypeRef)) {
				this.sarlBehavior.setExtends(superTypeRef);
				return;
			}
		}
		this.sarlBehavior.setExtends(null);
	}
1162804
def fetch_datatype(self, bucket, key, r=None, pr=None, basic_quorum=None,
                       notfound_ok=None, timeout=None, include_context=None):
        
        raise NotImplementedError
885407
def check(self, check_all=True, do_reload=True):
        """"""
        with enaml.imports():
            super(EnamlReloader, self).check(check_all=check_all, do_reload=do_reload)
583178
function(type, checks) {
		var result = false;
		var list = this._trackedtypes[type];
		if (list) {
			var index = this._checksindex(list, checks);
			if (index > -1) {
				result = true;
				// TODO: this seems to not run when checks is none (undefined)!
				if (gui.Array.remove(list, index) === 0) {
					delete this._trackedtypes[type];
				}
			}
		}
		return result;
	}
764984
void checkDataReadOnly() {

        if (dataSource.length() == 0) {
            throw Error.error(ErrorCode.TEXT_TABLE_UNKNOWN_DATA_SOURCE);
        }

        if (isReadOnly) {
            throw Error.error(ErrorCode.DATA_IS_READONLY);
        }
    }
645678
def _is_date_data(self, data_type):
        """"""
        dt = DATA_TYPES[data_type]
        if isinstance(self.data, dt['type']):
            self.type = data_type.upper()
            self.len = None
            return True
1277009
private void checkType(BtrpOperand e) {
        if (!(e instanceof BtrpNumber)) {
            throw new UnsupportedOperationException(e + " must be a '" + prettyType() + "' instead of a '" + e.prettyType() + "'");
        }
    }
1081592
def method_missing(sym, *args, &block)
      if (data && data[sym])
        data[sym]
      else
        super(sym, *args, &block)
      end
    end
861323
def update_datatype(self, datatype, w=None, dw=None, pw=None,
                        return_body=None, timeout=None, include_context=None):
        
        raise NotImplementedError
16048
def check_type(param, datatype):
    
    if param is None:
        return param

    if getattr(datatype, 'clean', None) and callable(datatype.clean):
        try:
            return datatype.clean(param)
        except ValueError:
            raise BadArgumentError(param)

    elif isinstance(datatype, str):
        # You've given it something like `'bool'` as a string.
        # This is the legacy way of doing it.
        datatype = {
            'str': str,
            'bool': bool,
            'float': float,
            'date': datetime.date,
            'datetime': datetime.datetime,
            'timedelta': datetime.timedelta,
            'json': 'json',  # exception
            'int': int,
        }[datatype]

    if datatype is str and not isinstance(param, basestring):
        try:
            param = str(param)
        except ValueError:
            param = str()

    elif datatype is int and not isinstance(param, int):
        try:
            param = int(param)
        except ValueError:
            param = int()

    elif datatype is bool and not isinstance(param, bool):
        param = str(param).lower() in ("true", "t", "1", "y", "yes")

    elif (
        datatype is datetime.datetime and
        not isinstance(param, datetime.datetime)
    ):
        try:
            param = dtutil.string_to_datetime(param)
        except ValueError:
            param = None

    elif datatype is datetime.date and not isinstance(param, datetime.date):
        try:
            param = dtutil.string_to_datetime(param).date()
        except ValueError:
            param = None

    elif (
        datatype is datetime.timedelta and
        not isinstance(param, datetime.timedelta)
    ):
        try:
            param = dtutil.strHoursToTimeDelta(param)
        except ValueError:
            param = None

    elif datatype == "json" and isinstance(param, basestring):
        try:
            param = json.loads(param)
        except ValueError:
            param = None

    return param
786220
private void checkm() throws DatatypeException, IOException {
        if (context.length() == 0) {
            appendToContext(current);
        }
        current = reader.read();
        appendToContext(current);
        skipSpaces();

        checkArg('m', "x coordinate");
        skipCommaSpaces();
        checkArg('m', "y coordinate");

        boolean expectNumber = skipCommaSpaces2();
        _checkl('m', expectNumber);
    }
1348056
function (type) {
            var ret = null, meth;
            if (isString(type)) {
                ret = this._static.CAST_TYPES[type] || this._super(arguments);
            } else if (type === String) {
                meth += "CHAR";
            } else if (type === Number) {
                meth += "DECIMAL";
            } else if (type === DateTime) {
                meth += "DATETIME";
            } else if (type === Year) {
                meth += "Year";
            } else if (type === Time) {
                meth += "DATETIME";
            } else if (type === Double) {
                meth += "DECIMAL";
            } else {
                ret = this._super(arguments);
            }
            return ret;
        }
1291891
public function syncClassInheritance()
	{
		$this->pdo->exec('DELETE FROM "meta_extends"');
			
		// Find all types that do not extend from a known class.
		$sql = '	INSERT INTO "meta_extends"
					SELECT t."name", t."name", 0
					FROM "meta_type" AS t
					LEFT JOIN "meta_type_hierarchy" AS h ON (h."subtype" = t."name")
					LEFT JOIN "meta_type" AS t1 ON (t1."name" = h."supertype")
					WHERE t."modifiers" & :class
					GROUP BY t."name"
					HAVING COUNT(t1."name") = 0 OR (BIT_OR(t1."modifiers") & :class) = 0
		';
		$stmt = $this->pdo->prepare($sql);
		$stmt->bindValue('class', MetaInfo::IS_CLASS);
		$stmt->execute();
		
		$inserts = (int)$stmt->rowCount();
		$level = 0;
		
		// Insert inherited paths starting from existing parents.
		$sql = '	INSERT INTO "meta_extends"
					SELECT e."ancestor", h."subtype", e."length" + 1
					FROM "meta_type_hierarchy" AS h
					INNER JOIN "meta_extends" AS e ON (e."descendant" = h."supertype")
					INNER JOIN "meta_extends" AS s ON (s."descendant" = h."supertype")
					WHERE s."length" = :level
					UNION ALL
					SELECT h."subtype", h."subtype", 0
					FROM "meta_type_hierarchy" AS h
					WHERE h."supertype" IN (
						SELECT "descendant"
						FROM "meta_extends"
						WHERE "length" = :level
					)
		';
		$stmt = $this->pdo->prepare($sql);
		
		while($inserts > 0)
		{
			if($level > 40)
			{
				throw new \RuntimeException(sprintf('Inheritance tree deeper than 40 levels? Are you serious?!'));
			}
				
			$stmt->execute(['level' => $level]);
				
			$inserts = (int)$stmt->rowCount();
			$level++;
		}
		
		$this->pdo->exec("ANALYZE");
	}