Returns a set of file lines that contains the intersection of the lines
        within this set and a given set.
506465
def intersection(self, other: 'FileLineSet') -> 'FileLineSet':
        
        assert isinstance(other, FileLineSet)
        set_self = set(self)
        set_other = set(other)
        set_union = set_self & set_other
        return FileLineSet.from_list(list(set_union))
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;
}
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
107756
function findLineIntersections(line, crossCheckLines) {
        return util.toArray(crossCheckLines).reduce(function(res, crossCheckLine) {
            var intersection = line.intersection(crossCheckLine);
            if (intersection) {
                res.push(intersection);
            }
            return res;
        }, []);
    }
552823
@SafeVarargs
	public static <T> Collection<T> intersection(Collection<T> coll1, Collection<T> coll2, Collection<T>... otherColls) {
		Collection<T> intersection = intersection(coll1, coll2);
		if (isEmpty(intersection)) {
			return intersection;
		}
		for (Collection<T> coll : otherColls) {
			intersection = intersection(intersection, coll);
			if (isEmpty(intersection)) {
				return intersection;
			}
		}
		return intersection;
	}
77395
@SuppressWarnings("unchecked")
    public static <E> List<E> intersection(final List<E> list, final List<E> ... lists) {
        final Stack<List<E>> stack = new Stack<List<E>>();
        stack.push(list);
        for (int index = 0; index < lists.length; index += 1) {
          stack.push(intersection(stack.peek(), lists[index]));
        }
        return stack.peek();
    }
839405
def intersection(self, *args):
        
        if type(self.obj[0]) is int:
            a = self.obj
        else:
            a = tuple(self.obj[0])
        setobj = set(a)
        for i, v in enumerate(args):
            setobj = setobj & set(args[i])
        return self._wrap(list(setobj))
1159687
public static int intersectLine (double x1, double y1, double x2, double y2, double rx1,
                                     double ry1, double rx2, double ry2) {
        // LEFT/RIGHT/UP
        if ((rx2 < x1 && rx2 < x2) || (rx1 > x1 && rx1 > x2) || (ry1 > y1 && ry1 > y2)) {
            return 0;
        }

        // DOWN
        if (ry2 < y1 && ry2 < y2) {

        } else {
            // INSIDE
            if (x1 == x2) {
                return CROSSING;
            }

            // Build bound
            double bx1, bx2;
            if (x1 < x2) {
                bx1 = x1 < rx1 ? rx1 : x1;
                bx2 = x2 < rx2 ? x2 : rx2;
            } else {
                bx1 = x2 < rx1 ? rx1 : x2;
                bx2 = x1 < rx2 ? x1 : rx2;
            }
            double k = (y2 - y1) / (x2 - x1);
            double by1 = k * (bx1 - x1) + y1;
            double by2 = k * (bx2 - x1) + y1;

            // BOUND-UP
            if (by1 < ry1 && by2 < ry1) {
                return 0;
            }

            // BOUND-DOWN
            if (by1 > ry2 && by2 > ry2) {
            } else {
                return CROSSING;
            }
        }

        // EMPTY
        if (x1 == x2) {
            return 0;
        }

        // CURVE-START
        if (rx1 == x1) {
            return x1 < x2 ? 0 : -1;
        }

        // CURVE-END
        if (rx1 == x2) {
            return x1 < x2 ? 1 : 0;
        }

        if (x1 < x2) {
            return x1 < rx1 && rx1 < x2 ? 1 : 0;
        }
        return x2 < rx1 && rx1 < x1 ? -1 : 0;
    }
667666
public static <E> Set<E> intersection(Set<E> first, Set<E> second) {
        if (first == null || second == null) {
            return EMPTY_SET;
        }

        Set<E> intersection = new HashSet<>();

        for (E e : first) {
            if (second.contains(e)) {
                intersection.add(e);
            }
        }
        return intersection;
    }
252775
public static <T> Set<T> intersection(Set<T>... sets) {
		return intersection(Arrays.asList(sets));
	}
926913
function lineRectangleIntersection(line, rect) {
  const intersections = [];

  Object.keys(rect).forEach(function(side) {
    const segment = rect[side];
    const intersection = line.intersectLine(segment);

    if (intersection) {
      intersections.push(intersection);
    }
  });

  return intersections;
}
1345541
public static <T> Set<T> intersection(Collection<Set<T>> sets) {
		Set<T> result = new HashSet<>();
		if (sets.isEmpty()) {
			return result;
		}
		Iterator<Set<T>> iter = sets.iterator();
		result.addAll(iter.next());
		while (iter.hasNext()) {
			result.retainAll(iter.next());
		}
		return result;
	}
1345230
public void intersection(Formats other, Formats intersection) {
        intersection.list.clear();
        for (Format f1 : list) {
            for (Format f2 : other.list) {
                if (f1.matches(f2)) intersection.list.add(f2);
            }
        }
    }
558064
public static <T> Set<T> intersection(Collection<T> parentCollection, Collection<T> removeFromCollection) {
        Set<T> results = new HashSet<>(parentCollection);
        results.retainAll(removeFromCollection);
        return results;
    }
232577
private boolean intersection(final long pX0, final long pY0, final long pX1, final long pY1) {
        return intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax) // x min segment
                || intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax) // x max segment
                || intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMax, mYMin) // y min segment
                || intersection(pX0, pY0, pX1, pY1, mXMin, mYMax, mXMax, mYMax); // y max segment
    }
471341
private Set<LineString> getSegments(Collection<LineString> lines) {
        Set<LineString> set = new HashSet<>();
        for (LineString line : lines) {
            Coordinate[] cc = line.getCoordinates();
            for (int i = 1; i < cc.length; i++) {
                if (!cc[i - 1].equals(cc[i])) {
                    LineString segment = line.getFactory().createLineString(
                            new Coordinate[]{new Coordinate(cc[i - 1]), new Coordinate(cc[i])});
                    set.add(segment);
                }
            }
        }
        return set;
    }
498284
public static long intersectionCount(OpenBitSet a, OpenBitSet b) {
        return BitUtil.pop_intersect( a.bits, b.bits, 0, Math.min( a.wlen, b.wlen ) );
    }