Performs simple checks to see if the data structure is avlid
343103
public void sanityCheck() {
		for( View v : nodes ) {
			for( Motion m : v.connections ) {
				if( m.viewDst != v && m.viewSrc != v )
					throw new RuntimeException("Not member of connection");
			}
		}
		for( Motion m : edges ) {
			if( m.viewDst != m.destination(m.viewSrc) )
				throw new RuntimeException("Unexpected result");
		}

	}
981648
def is_collection?(obj, follow_symbols = true)
      data_obj = follow_symbols ? data_object(obj) : obj
      data_obj &&
        data_obj.is_a?(Enumerable) &&
        !(data_obj.is_a?(Struct) ||
          defined?(Hashie::Mash) && data_obj.is_a?(Hashie::Mash))
    end
541665
static boolean isExternalAVFile(AVFile avFile) {
    return null != avFile
            && null != avFile.getMetaData()
            && avFile.getMetaData().containsKey("__source")
            && avFile.getMetaData().get("__source").equals("external");
  }
1159254
def check_data(yaml_data, errors_array)
      valid = check_not_empty?(yaml_data, errors_array)
      valid &&= check_syntax_valid?(yaml_data, errors_array)
      valid &&= check_overlapping_keys?(yaml_data, errors_array)

      valid
    end
698568
def is_valid(cls, arg):
        """"""
        if isinstance(arg, list):
            allInts = allStrings = True
            for elem in arg:
                allInts = allInts and ((elem == 0) or (elem == 1))
                allStrings = allStrings and elem in cls.bitNames

            if allInts or allStrings:
                return True
        return False
965864
private boolean primitiveEquals(
        Object switchVal, Object targetVal,
        CallStack callstack, SimpleNode switchExp  )
        throws EvalError
    {
        if (targetVal == Primitive.VOID)
            return false;
        if ( switchVal instanceof Primitive || targetVal instanceof Primitive )
            try {
                // binaryOperation can return Primitive or wrapper type
                Object result = Operators.binaryOperation(
                    switchVal, targetVal, ParserConstants.EQ );
                result = Primitive.unwrap( result );
                return result.equals( Boolean.TRUE );
            } catch ( UtilEvalError e ) {
                throw e.toEvalError(
                    "Switch value: "+switchExp.getText()+": ",
                    this, callstack );
            }
        else
            return switchVal.equals( targetVal );
    }
92206
def _isclose(obja, objb, rtol=1e-05, atol=1e-08):
    """"""
    return abs(obja - objb) <= (atol + rtol * abs(objb))
1869
def checkattr(metacls, attr, value):
        
        if not isinstance(value, (
                types.MethodType,
                types.FunctionType,
                classmethod,
                staticmethod,
                property)):
            if attr in dir(type('dummy', (object,), {})) + \
                    ['__metaclass__', '__qualname__']:
                return
            if attr.startswith('_'):
                raise SyntaxError(
                    "TreeModel attribute `{0}` "
                    "must not start with `_`".format(attr))
            if not inspect.isclass(value):
                if not isinstance(value, Column):
                    raise TypeError(
                        "TreeModel attribute `{0}` "
                        "must be an instance of "
                        "`rootpy.tree.treetypes.Column`".format(attr))
                return
            if not issubclass(value, (ROOT.TObject, ROOT.ObjectProxy)):
                raise TypeError(
                    "TreeModel attribute `{0}` must inherit "
                    "from `ROOT.TObject` or `ROOT.ObjectProxy`".format(
                        attr))
857235
private boolean checkPattern(Mtp2Buffer frame, int sltmLen, byte[] pattern) {
        if (sltmLen != pattern.length) {
            return false;
        }
        for (int i = 0; i < pattern.length; i++) {
            if (frame.frame[i + PATTERN_OFFSET] != pattern[i]) {
                return false;
            }
        }
        return true;
    }
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)
947060
def _assertsanity(self):
        """"""
        assert self.len >= 0
        assert 0 <= self._offset, "offset={0}".format(self._offset)
        assert (self.len + self._offset + 7) // 8 == self._datastore.bytelength + self._datastore.byteoffset
        return True
33616
function isMultipleArray(valueStr) {
  var wrappedValueStr = '[ ' + valueStr + ' ]';
  var wrappedArray = createArray(wrappedValueStr, {}, {
    checkMultipleArray: false
  });
  return wrappedArray.children.length > 1;
}
674840
function(v) {
		return _.isNil(v) || (_.isString(v) && _.isEmpty(v));
	}
593813
function isTypedArray (obj) {
  if (typeof obj === 'object') {
    for (var i = 0; i < supportedDataTypes.length; i++) {
      if (obj instanceof supportedDataTypes[i]) {
        return true;
      }
    }
  }
}
280105
def check(self, values, namespace):
        """"""
        is_tuplish_type = (issubclass(self._cls, tg.Tuple) or
                           issubclass(type(values), self._cls))
        if (not _is_sequence(values) or not is_tuplish_type or
                len(values) != len(self._checks)):
            return False
        for thischeck, thisvalue in zip(self._checks, values):
            if not thischeck(thisvalue, namespace):
                return False
        return True
155189
def is_single_tree(data_wrapper):
    '''
    '''
    db = data_wrapper.data_block
    bad_ids = db[db[:, COLS.P] == -1][1:, COLS.ID]
    return CheckResult(len(bad_ids) == 0, bad_ids.tolist())
965022
def check(self, radl):
        """"""
        SIMPLE_FEATURES = {
            "name": (str, lambda x, _: bool(x.value)),
            "path": (str, lambda x, _: bool(x.value)),
            "version": (str, is_version),
            "preinstalled": (str, ["YES", "NO"])
        }
        self.check_simple(SIMPLE_FEATURES, radl)