Check that an item contains another item, either a string, array, or object.
514179
function(val, item) {
    if (_.isString(val)) return val.indexOf(item) !== -1;
    if (_.isArray(val))  return _.indexOf(val, item) !== -1;
    if (_.isObject(val)) return _.has(val, item);
    return false;
  }
830324
def contains(container, item):
    """"""

    # equality counts as containment and is usually non destructive
    if container == item:
        return True

    # testing mapping containment is usually non destructive
    if isinstance(container, abc.Mapping) and mapping_contains(container, item):
        return True

    # standard containment except special cases
    if isinstance(container, str):
        # str __contains__ includes substring match that we don't count as containment
        if strict_contains(container, item):
            return True
    else:
        try:
            if item in container:
                return True
        except Exception:
            pass

    # search matches in generic instances
    return instance_contains(container, item)
53919
public static final <T> boolean contains(T[] array, T item)
    {
        for (T b : array)
        {
            if (b.equals(item))
            {
                return true;
            }
        }
        return false;
    }
1283572
function check(name) {
        try {
            var storage = window[name];
            var key = 'foo';
            var value = 'bar';

            storage.setItem(key, value);
            var support = value === storage.getItem(key);
            storage.removeItem(key);

            return support;
        }
        catch (e) {
            return false;
        }
    }
1072753
function has(obj, key) {
    if (!is_1.isObject(obj) || (!is_1.isArray(key) && !is_1.isString(key)))
        return false;
    obj = assign({}, obj);
    var props = is_1.isArray(key) ? key : string_1.split(key);
    while (props.length && obj) {
        var prop = props.shift(), match = matchIndex(prop);
        if (!props.length) { // no more props chek path.
            var _keys = array_1.keys(obj);
            if (match) {
                return array_1.contains(_keys, match.name) && is_1.isValue(obj[match.name][match.index]);
            }
            else {
                return array_1.contains(_keys, prop);
            }
        }
        if (match) {
            /* istanbul ignore next  */
            if (!is_1.isUndefined(obj[match.name])) {
                obj = obj[match.name][match.index];
                // iterate each indices and set obj to that index.
                match.indices.forEach(function (i) { return obj = obj[i]; });
            }
        }
        else {
            obj = obj[prop];
        }
    }
}
1021113
def is_in(val, items):
    
    if isinstance(items, basestring):
        items = items.split('|')
    return val in items
689623
def contains(self, data):
        
        for item in self:
            if item.data() == data:
                return True
        return False
407173
function(list, property) {
      if (_.isArray(list)) {
        return _.some(list, function(item) { return _.has(item, property); });
      } else {
        return _.has(list, property);
      }
    }
253058
function containsSingleMatch(str, arr) {
  var filtered = arr.filter(function(e) { return e.indexOf(str) === 0 })
  return filtered.length === 1
}
637138
def contains_any(self, other):
        
        return self.value == other.value or self.value & other.value
280030
function contains(arr, element) {
        for (var i = 0, len = arr.length; i < len; i++) {
            if (arr[i] === element) {
                return true;
            }
        }
        return false;
    }
521747
function itemIsValid(item) {
    if (!('isValid' in item)) {
      return true;
    }
    if (_.isFunction(item.isValid)) {
      return item.isValid();
    }
    return false;
  }
1117812
def is_collection(obj):
    """"""

    col = getattr(obj, '__getitem__', False)
    val = False if (not col) else True

    if isinstance(obj, basestring):
        val = False

    return val
751748
function contains( arr, value ) {
	var len, i;
	if ( !isArray( arr ) ) {
		throw new TypeError( 'contains()::invalid input argument. First argument must be an array. Value: `' + arr + '`.' );
	}
	len = arr.length;
	if ( isnan( value ) ) {
		for ( i = 0; i < len; i++ ) {
			if ( isnan( arr[ i ] ) ) {
				return true;
			}
		}
		return false;
	}
	for ( i = 0; i < len; i++ ) {
		if ( arr[ i ] === value ) {
			return true;
		}
	}
	return false;
}
682789
@Override
    public final boolean matches(Object item, Description mismatch) {
        if (matches(item)) {
            return true;
        } else {
            describeMismatch(item, mismatch);
            return false;
        }
    }
261800
function some(array, member) {
        if(isUndefined(member)) {
          return false;
        }
        return array.some(function(el) {
          return equals(el, member);
        });
      }
1216806
def contains(self, other):
        
        return (self.left <= other.left and
                self.right >= other.right and
                self.top >= other.top and
                self.bottom <= other.bottom)