Finds common values

    :param lists: List of lists
    :return: List of values that are in common between inner lists
198995
def find_commons(lists):
    
    others = lists[1:]
    return [
        val
        for val in lists[0]
        if is_in_all(val, others)
    ]
128833
def list_same(list_a, list_b):
    
    result = []
    for item in list_b:
        if item in list_a:
            result.append(item)
    return result
968881
def _common_scan(self, values_function, cursor='0', match=None, count=10, key=None):
        
        if count is None:
            count = 10
        cursor = int(cursor)
        count = int(count)
        if not count:
            raise ValueError('if specified, count must be > 0: %s' % count)

        values = values_function()
        if cursor + count >= len(values):
            # we reached the end, back to zero
            result_cursor = 0
        else:
            result_cursor = cursor + count

        values = values[cursor:cursor+count]

        if match is not None:
            regex = re.compile(b'^' + re.escape(self._encode(match)).replace(b'\\*', b'.*') + b'$')
            if not key:
                key = lambda v: v
            values = [v for v in values if regex.match(key(v))]

        return [result_cursor, values]
632616
def list_diff(list_a, list_b):
    
    result = []
    for item in list_b:
        if not item in list_a:
            result.append(item)
    return result
231870
def no_overlap(multienum):
    
    duplicates = []
    members = []

    for member in multienum.__members__.values():
        for prev_member in members:
            intersection = set(member._value_) & set(prev_member._value_)
            if intersection:
                duplicates.append((member._name_, prev_member._name_, intersection))
        members.append(member)

    if duplicates:
        alias_details = ', '.join(["{} & {} -> {}".format(alias, name, intersection)
                                  for (alias, name, intersection) in duplicates])
        raise ValueError('common element found in {!r}: {}'
                         .format(multienum, alias_details))
    return multienum
372470
@SuppressWarnings("unchecked")
    public static <E> List<E> union(final List<E> list, final List<E> ... lists) {
        final Set<E> union = newLinkedHashSet();
        union.addAll(list);
        for (List<E> localList : lists) {
            union.addAll(localList);
        }
        return newArrayList(union);
    }
552084
def same_as(self, rows: List[Row], column: Column) -> List[Row]:
        
        cell_value = rows[0].values[column.name]
        return_list = []
        for table_row in self.table_data:
            if table_row.values[column.name] == cell_value:
                return_list.append(table_row)
        return return_list
1275166
def contigsub(a,b):
  ''
  'a and b are token lists'
  common=commonelts(a,b); groupsa=groupelts(a,common); groupsb=groupelts(b,common)
  bestmatch=[None,None,0]; bslice=None
  for i in range(len(groupsb)):
    if not groupsb[i][0]: continue
    if len(groupsb[i])-1<=bestmatch[2]: continue # this whole segment can't beat our best match so far
    for j in range(len(groupsb[i])):
      match=seqingroups(groupsa,groupsb[i][j:])
      if match and match[2]>bestmatch[2]: bestmatch=match; bslice=[i,j,match[2]]
      if match and match[2]>=(len(groupsb[i])/2.0): break # i.e. this is as good as we're going to get for groupsb[i], skip the rest. TODO: write a test for this
  return None if not bestmatch[2] else (ungroupslice(groupsa,bestmatch),ungroupslice(groupsb,bslice))
408901
def column_lists_equal(a: List[Column], b: List[Column]) -> bool:
    
    n = len(a)
    if len(b) != n:
        return False
    for i in range(n):
        if not columns_equal(a[i], b[i]):
            log.debug("Mismatch: {!r} != {!r}", a[i], b[i])
            return False
    return True
1162352
public static <T> List<T> getLeftDiff(List<T> list1, List<T> list2) {
        if (isEmpty(list2)) {
            return list1;
        }
        List<T> list = new ArrayList<T>();
        if (isNotEmpty(list1)) {
            for (T o : list1) {
                if (!list2.contains(o)) {
                    list.add(o);
                }
            }
        }
        return list;
    }
75040
def is_in_list(self, plane_list):
        
        for plane in plane_list:
            if self.is_same_plane_as(plane):
                return True
        return False
893740
private static List<Node> difference(List<Node> listA, List<Node> listB) {
        if(listA != null && listB != null)
            listA.removeAll(listB);
        return listA;
    }
580900
def _group_similar(items: List[T],
                   comparer: Callable[[T, T], bool]) -> List[List[T]]:
    
    groups = []  # type: List[List[T]]
    used = set()  # type: Set[int]
    for i in range(len(items)):
        if i not in used:
            group = [items[i]]
            for j in range(i + 1, len(items)):
                if j not in used and comparer(items[i], items[j]):
                    used.add(j)
                    group.append(items[j])
            groups.append(group)
    return groups
594230
def common_attributes(self):
        
        features = self._data["features"]
        if not features: return []
        elif len(features) == 1: return features[0]["properties"].keys()
        else:
            fields = set(features[0]["properties"].keys())
            for feature in features[1:]:
                fields.intersection_update(feature["properties"].keys())
            return list(fields)
500563
public static boolean compareQNameLists(List<QName> list1, List<QName> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!compareQNames(list1.get(i), list2.get(i)))
                return false;
        }

        return true;
    }
1026532
def compare(dicts):
    """"""

    common_members = {}
    common_keys = reduce(lambda x, y: x & y, map(dict.keys, dicts))
    for k in common_keys:
        common_members[k] = list(
            reduce(lambda x, y: x & y, [set(d[k]) for d in dicts]))

    return common_members
22975
def _consolidate_slices(slices):
    
    result = []
    last_slice = slice(None)
    for slice_ in slices:
        if not isinstance(slice_, slice):
            raise ValueError('list element is not a slice: %r' % slice_)
        if (result and last_slice.stop == slice_.start and
                _is_one_or_none(last_slice.step) and
                _is_one_or_none(slice_.step)):
            last_slice = slice(last_slice.start, slice_.stop, slice_.step)
            result[-1] = last_slice
        else:
            result.append(slice_)
            last_slice = slice_
    return result