Check:
     - that the list of items is iterable and finite.
     - that the list is not empty
357939
def _check_items(items):
    '''
    
    '''
    num_items = 0
    # Check that the list is iterable and finite
    try:
        num_items = len(items)
    except:
        raise TypeError("The item list ({}) is not a finite iterable (has no length)".format(items))
    # Check that the list has items
    if num_items == 0:
        raise ValueError("The item list is empty.")
449290
def check(self, data):
        """"""
        if isinstance(data, Iterable):
            data = "".join(str(x) for x in data)
        try:
            data = str(data)
        except UnicodeDecodeError:
            return False
        return bool(data and self.__regexp.match(data))
982929
def iskip( value, iterable ):
    

    for e in iterable:
        if value is None:
            if e is None:
                continue
        elif e == value:
            continue
        yield e
1161186
def _is_non_string_iterable(value):
    """"""
    if isinstance(value, str):
        return False
    if hasattr(value, '__iter__'):
        return True
    if isinstance(value, collections.abc.Sequence):
        return True
    return False
1251181
def iscontinuous(self):
        """"""
        return all(self[i].end == self[i+1].start for i in range(len(self) - 1))
299039
function isValueInList(list, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i] == value) {
            return true;
        }
    }
    return false;
}
1266254
def this_and_prev(iterable):
    """"""
    try:
        item = next(iterable)
        while True:
            next_item = next(iterable)
            yield item, next_item
            item = next_item
    except StopIteration:
        return
1365985
public final void containsAnyIn(Iterable<?> expected) {
    Collection<?> actual = iterableToCollection(actual());
    for (Object item : expected) {
      if (actual.contains(item)) {
        return;
      }
    }
    if (hasMatchingToStringPair(actual, expected)) {
      failWithoutActual(
          fact("expected to contain any of", countDuplicatesAndAddTypeInfo(expected)),
          simpleFact("but did not"),
          fact(
              "though it did contain",
              countDuplicatesAndAddTypeInfo(
                  retainMatchingToString(actual(), expected /* itemsToCheck */))),
          fullContents());
    } else {
      failWithActual("expected to contain any of", expected);
    }
  }
183005
def is_finite(self):
        
        return not np.isinf(self.min) and not np.isinf(self.max)
1311675
function isIterable(was){
		return _.isObject(was) && !_.isFunction(was) && !_.isArray(was);
	}
286931
private boolean contains(List<String> list, String item) {
        return (null == list) ? false : list.contains(item);
    }
1010614
public static <T> boolean isEmpty(final Iterable<T> iterable) {
        return iterable == null || !iterable.iterator().hasNext();
    }
14064
public boolean isListableType() {
        return (type == ItemType.ARRAY || type == ItemType.LIST || type == ItemType.SET);
    }
1203998
def iterable(target):
    '''  '''
    if any(i in ('next', '__next__', '__iter__') for i in dir(target)):
        return True
    else:
        try:
            iter(target)
            return True
        except:
            return False
760246
def ensure_list(iterable: Iterable[A]) -> List[A]:
    
    if isinstance(iterable, list):
        return iterable
    else:
        return list(iterable)
497191
def are_in(items, collection):
    
    if not isinstance(items, (list, tuple)):
        items = (items, )
    return map(lambda x: x in collection, items)
1160454
def iscontainer(*items):
    
    return all(isinstance(i, Iterable) and not isinstance(i, basestring)
               for i in items)