Check an object for empiness
542964
function (type, item) {
        switch(type) {
            case simpleTypes.undefined:
            case simpleTypes.null:
                return true;
            case simpleTypes.string:
                if (item.trim().length === 0) {
                    return true;
                }
                return false;
            case simpleTypes.object:
                return (Object.keys(item).length === 0);
            case simpleTypes.array:
                return (item.length === 0);
            default:
                return false;
        };
    }
48396
def matches(self, object):
    

    try:
      self.check_match(object)
    except securesystemslib.exceptions.FormatError:
      return False
    else:
      return True
691087
def _validate_items(self, path, obj, _):
        
        errs = []

        if obj.type == 'void':
            errs.append('void is only allowed in Operation object.')

        return path, obj.__class__.__name__, errs
133494
function (obj) {
			this.writeDebug('isEmptyObject',arguments);
			for (var key in obj) {
				if (obj.hasOwnProperty(key)) {
					return false;
				}
			}
			return true;
		}
907310
function(obj, desc){
        this.assert(
            this.obj.some(function(item) { return eql(obj, item); })
            , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (desc ? " | " + desc : "") }
            , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (desc ? " | " + desc : "") });
        return this;
    }
1338846
function check(user, obj, guards) {
  if (!Array.isArray(guards))
    guards = Array.prototype.slice.call(arguments, 2);
  for (var i = 0; i < guards.length; i++) {
    if (guards[i] === undefined)
      continue;
    var test = guards[i].check(user, obj);
    if (test !== undefined)
      return test;
  }
  return undefined;
}
126202
function isTrueEmpty(obj) {
  if (obj === undefined || obj === null || obj === '') return true;
  if (exports.isNumber(obj) && isNaN(obj)) return true;
  return false;
}
200509
def check(self, pointer, expected, raise_onerror=False):
        
        obj = self.document
        for token in Pointer(pointer):
            try:
                obj = token.extract(obj, bypass_ref=True)
            except ExtractError as error:
                if raise_onerror:
                    raise Error(*error.args)
                logger.exception(error)
                return False
        return obj == expected
11890
def check(object, mode = @mode)
      checked = {}
      result = true
      errors = CheckFailed.new
      each do |message|
        begin
          message.check(object, checked)
        rescue CheckError => e
          case mode
          when :error
            errors << e
          when :warning
            warn e.to_s
            result = false
          when :none
            result = false
          end
        end
      end
      raise errors unless errors.empty?
      result
    end
678893
def has_property(obj, name):
        
        if obj == None:
            raise Exception("Object cannot be null")
        if name == None:
            raise Exception("Property name cannot be null")

        name = name.lower()

        for property_name in dir(obj): 
            if property_name.lower() != name:
                continue

            property = getattr(obj, property_name)

            if PropertyReflector._is_property(property, property_name):
                return True
        
        return False
959109
def check_property(prop, name, **kwargs):
    

    checkers = {
        'color': check_color,
        'alpha': check_alpha,
        'size': check_size,
        'thickness': check_thickness,
        'index': check_index,
        'coordinates': check_coordinates,
        'colormap': check_colormap,
        'bins': check_bins,
        'spec': check_spec
    }

    if name in checkers:
        return checkers[name](prop, **kwargs)
    elif isinstance(prop, list) or isinstance(prop, ndarray) or isscalar(prop):
        return check_1d(prop, name)
    else:
        return prop
837593
def check_str(obj):
        
        if isinstance(obj, str):
            return obj
        if isinstance(obj, float):
            return str(int(obj))
        else:
            return str(obj)
690072
def _checkType(self, obj, identifier):
        """"""
        if not isinstance(obj, basestring):
            raise TypeError("expected %s '%s' to be a string (was '%s')" %
                            (identifier, obj, type(obj).__name__))
469722
function isPropTracked(obj, prop) {
            var desc = Object.getOwnPropertyDescriptor(obj, prop);
            return (desc.get != undefined && desc.set != undefined);
        }
282511
def validate_obj(keys, obj):
    """"""
    msg = ''
    for k in keys:
        if isinstance(k, str):
            if k not in obj or (not isinstance(obj[k], list) and not obj[k]):
                if msg:
                    msg = "%s," % msg

                msg = "%s%s" % (msg, k)
        elif isinstance(k, list):
            found = False
            for k_a in k:
                if k_a in obj:
                    found = True

            if not found:
                if msg:
                    msg = "%s," % msg

                msg = "%s(%s" % (msg, ','.join(k))

    if msg:
        msg = "%s missing" % msg

    return msg
1086952
function( name, actual, expected ) {
		var self = this, passed = true;

		try {
			self._objectMatch( actual, expected );
			passed = false;
		}
		catch ( e ) {
		}
		
		return self.ok( name, passed, self.notDeepEqual, 'Objects are not supposed to match' );
	}
1157333
function (obj) {
			this.writeDebug('hasEmptyObjectVals',arguments);
				var objTest = true;

				for(var key in obj) {
					if (obj.hasOwnProperty(key)) {
						if (obj[key] !== '' && obj[key].length !== 0) {
							objTest = false;
						}
					}
				}

				return objTest;
		}