Return True for each item in the collection

    :param items: a sub-collection
    :param collection: a collection
    :returns: a list of booleans

    >>> are_in(['Terry', 'James'], ['Terry', 'John', 'Eric'])
    [True, False]
497191
def are_in(items, collection):
    
    if not isinstance(items, (list, tuple)):
        items = (items, )
    return map(lambda x: x in collection, items)
411630
def is_list_of_list(item):
    
    if (
        type(item) in (list, tuple)
        and len(item)
        and isinstance(item[0], (list, tuple))
    ):
        return True
    return False
786065
public function contains(... $items) : bool
    {
        $values = $this->getValues();
        foreach($items as $item)
        {
            if (!in_array($item, $values, true))
            {
                return false;
            }
        }
        return true;
    }
1077462
def one_of(*args):
    
    if len(args) == 1 and isinstance(args[0], list):
        items = args[0]
    else:
        items = list(args)

    def validate(value):
        if not value in items:
            return e("{} is not in the list {}", value, items)
    return validate
1365748
def counter(items):
    
    results = {}
    for item in items:
        results[item] = results.get(item, 0) + 1
    return results
1047174
def _in_items(self, restrictions):
        """"""
        def build_in(table, name, value):
            return "{}.{} IN ({})".format(table, name,
                                          ", ".join(["?"] * len(value)))

        in_items = self._build_where(restrictions, for_in=True)
        names = [build_in(*restriction) for restriction in in_items]
        values = list(chain(*[item[2] for item in in_items]))
        return (names, values)
495671
function isCollection(object) {
    if (!object || typeof object !== 'object') {
        return false;
    }
    else if ('isCollection' in object) {
        diag.debug.assert(function () { return object.isCollection === Collection.prototype.isPrototypeOf(object); });
        return object.isCollection;
    }
    else {
        return Collection.prototype.isPrototypeOf(object);
    }
}
1122801
public boolean addItems(Collection<T> items) {
        if (items.isEmpty()) return false;
        int previousSize = getItemCount();
        if (mListItems.addAll(items)) {
            notifyItemRangeInserted(previousSize, items.size());
            return true;
        }
        return false;
    }
826112
def is_in(allowed_values  # type: Set
          ):
    
    def is_in_allowed_values(x):
        if x in allowed_values:
            return True
        else:
            # raise Failure('is_in: x in ' + str(allowed_values) + ' does not hold for x=' + str(x))
            raise NotInAllowedValues(wrong_value=x, allowed_values=allowed_values)

    is_in_allowed_values.__name__ = 'is_in_{}'.format(allowed_values)
    return is_in_allowed_values
759081
def value_contains(self, value, attribute):
        
        for item in self[attribute]:
            if value in item:
                return True
        return False
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
1309613
private static final boolean contains(Collection<String> list, String value) {
        for (String item : list)
            if (item.contains(value))
                return true;
        return false;
    }
906214
def items
      item.items if item.respond_to?(:items) && item.items && item.items.any?
    end
600674
def setCheckedItems(self, items):
        
        if not self.isCheckable():
            return
        
        model = self.model()
        for i in range(self.count()):
            item_text = self.itemText(i)
            if not item_text:
                continue
            
            if nativestring(item_text) in items:
                state = Qt.Checked
            else:
                state = Qt.Unchecked
            
            model.item(i).setCheckState(state)
661250
def isDocumentCollection(cls, name) :
        """"""
        try :
            col = cls.getCollectionClass(name)
            return issubclass(col, Collection)
        except KeyError :
            return False
738769
static <T> boolean iterableContains(Iterable<T> iterable, T item) {
    if (iterable instanceof Collection) {
      Collection<?> collection = (Collection<?>) iterable;
      try {
        return collection.contains(item);
      } catch (NullPointerException e) {
        return false;
      } catch (ClassCastException e) {
        return false;
      }
    }
    for (T i : iterable) {
      if (Objects.equal(i, item)) {
        return true;
      }
    }
    return false;
  }
1229206
def _check_existence_by_collection(self, container, item_name):
        '''
        '''

        coll = container.get_collection()
        for item in coll:
            if item.name == item_name:
                return True
        return False