Returns the intersection of variants in several VariantCollection objects.
163417
def intersection(self, *others, **kwargs):
        
        return self._combine_variant_collections(
            combine_fn=set.intersection,
            variant_collections=(self,) + others,
            kwargs=kwargs)
533356
def get_variants(self, arch=None, types=None, recursive=False):
        
        types = types or []
        result = []

        if "self" in types:
            result.append(self)

        for variant in six.itervalues(self.variants):
            if types and variant.type not in types:
                continue
            if arch and arch not in variant.arches.union(["src"]):
                continue
            result.append(variant)
            if recursive:
                result.extend(variant.get_variants(types=[i for i in types if i != "self"], recursive=True))

        result.sort(key=lambda x: x.uid)
        return result
871205
def intersection_update(self, *others):
        """"""
        self.db.sinterstore(self.key, [o.key for o in [self.key] + others])
624800
public static final <T> boolean intersect(Collection<Set<T>> sets)
    {
        Set<T> set = intersection(sets);
        return !set.isEmpty();
    }
617418
public Map<String, String> resolveVariants(HttpServletRequest request) {

		Map<String, String> variants = new TreeMap<>();
		for (VariantResolver resolver : variantResolvers.values()) {
			String value = resolver.resolveVariant(request);
			if (value != null) {
				variants.put(resolver.getVariantType(), value);
			}
		}

		return variants;
	}
1258846
def iter_intersecting(self, iterable, key=None, descending=False):
        
        return _ContainsVersionIterator(self, iterable, key, descending,
            mode=_ContainsVersionIterator.MODE_INTERSECTING)
1082250
public static List<String> getAllVariantKeys(Map<String, ? extends Collection<String>> variants) {

		List<String> variantKeys = new ArrayList<>();
		for (Collection<String> variantList : new TreeMap<>(variants).values()) {
			if (variantKeys.isEmpty()) {
				variantKeys = getVariantKeys(null, variantList);
			} else {

				List<String> tmpResult = new ArrayList<>();
				for (String curVariantKey : variantKeys) {
					tmpResult.addAll(getVariantKeys(curVariantKey + JawrConstant.VARIANT_SEPARATOR_CHAR, variantList));
				}
				variantKeys = tmpResult;
			}
		}

		if (variantKeys.isEmpty()) {
			variantKeys.add(null);
		}
		return variantKeys;
	}
1266807
function intersection(sets) {
  let source = sets[0];
  let rest = sets.slice(1);
  let keys = Object.keys(source);
  let keysLength = keys.length;
  let restLength = rest.length;
  let result = [];
  for (let keyIndex = 0; keyIndex < keysLength; keyIndex++) {
    let key = keys[keyIndex];
    let matched = true;
    for (let restIndex = 0; restIndex < restLength; restIndex++) {
      if (!rest[restIndex].hasOwnProperty(key)) {
        matched = false;
        break;
      }
    }
    if (matched) {
      result.push(source[key]);
    }
  }
  return result;
}
756835
def allVariantAnnotationSets(self):
        
        for dataset in self.getDatasets():
            for variantSet in dataset.getVariantSets():
                for vaSet in variantSet.getVariantAnnotationSets():
                    yield vaSet
456220
private static List<String> getVariantKeys(String variantKeyPrefix, Collection<String> variants) {

		List<String> variantKeys = new ArrayList<>();
		for (String variant : variants) {
			if (variant == null) {
				variant = "";
			}
			if (variantKeyPrefix == null) {
				variantKeys.add(variant);
			} else {
				variantKeys.add(variantKeyPrefix + variant);
			}
		}

		return variantKeys;
	}
2376
def getAllAnnotationSets(self):
        
        for variantSet in self.getAllVariantSets():
            iterator = self._client.search_variant_annotation_sets(
                variant_set_id=variantSet.id)
            for variantAnnotationSet in iterator:
                yield variantAnnotationSet
96896
def intersection(self, *iterables):
        
        comb = self._set.intersection(*iterables)
        new_set = self.__class__(key=self._key, load=self._load, _set=comb)
        return new_set
485820
def intersection(*args):
    
    if not args:
        return []

    # remove duplicates from first list whilst preserving order
    base = list(OrderedDict.fromkeys(args[0]))

    if len(args) == 1:
        return base
    else:
        others = set(args[1]).intersection(*args[2:])
        return [e for e in base if e in others]
805937
def _node_has_variant(node: BaseEntity, variant: str) -> bool:
    
    return VARIANTS in node and any(
        variant_dict[KIND] == variant
        for variant_dict in node[VARIANTS]
    )
807904
def intersection(*argv):
        
        res = OrderedSet(argv[0])
        for ods in argv:
            res = ods & res
        return res
645239
private Map<String, String> getVariantMap(ResourceBundlesHandler bundlesHandler, String contextPath,
			String bundlePath) {

		JoinableResourceBundle bundle = bundlesHandler.resolveBundleForPath(bundlePath);
		Set<String> variantTypes = bundle.getVariants().keySet();

		String variantKey = getVariantKey(contextPath);
		String[] variantValues = new String[0];
		if (variantKey.length() > 0) {
			if (variantKey.length() == 1) {
				variantValues = new String[] { "", "" };
			} else {
				variantValues = variantKey.split(String.valueOf(JawrConstant.VARIANT_SEPARATOR_CHAR));
			}
		}

		Map<String, String> variants = new HashMap<>();
		if (variantTypes.size() != variantValues.length) {
			throw new BundlingProcessException("For the resource '" + contextPath
					+ "', the number variant types for the bundle don't match the variant values.");
		}
		int i = 0;
		for (String variantType : variantTypes) {
			variants.put(variantType, variantValues[i++]);
		}
		return variants;
	}
186211
def find_variant(name: str) -> Type[chess.Board]:
    """"""
    for variant in VARIANTS:
        if any(alias.lower() == name.lower() for alias in variant.aliases):
            return variant
    raise ValueError("unsupported variant: {}".format(name))