Handle intersection.
348158
function (evt) {
    var currentIntersection;
    var cursorEl = this.el;
    var index;
    var intersectedEl;
    var intersection;

    // Select closest object, excluding the cursor.
    index = evt.detail.els[0] === cursorEl ? 1 : 0;
    intersection = evt.detail.intersections[index];
    intersectedEl = evt.detail.els[index];

    // If cursor is the only intersected object, ignore the event.
    if (!intersectedEl) { return; }

    // Already intersecting this entity.
    if (this.intersectedEl === intersectedEl) { return; }

    // Ignore events further away than active intersection.
    if (this.intersectedEl) {
      currentIntersection = this.el.components.raycaster.getIntersection(this.intersectedEl);
      if (currentIntersection && currentIntersection.distance <= intersection.distance) { return; }
    }

    // Unset current intersection.
    this.clearCurrentIntersection(true);

    this.setIntersection(intersectedEl, intersection);
  }
711441
def intersection(self, other):
        
        if isinstance(other, self.__class__):
            return self.client.sinter([self.name, other.name])
        else:
            return self._as_set().intersection(other)
484676
def intersection(self, key, *others):
        """"""
        if not isinstance(key, str):
            raise ValueError("String expected.")
        self.db.sinterstore(key, [self.key] + [o.key for o in others])
        return Set(key)
978527
def intersection(self,other):
        ""
        res = {}
        if set(self.sets.keys()) != set(other.sets.keys()):
            raise KeyError('Incompatible patches in intersection')
        for name,s1 in self.sets.items():
            s2 = other.sets[name]
            res[name] = s1.intersection(s2)
        return Patch(res)
10993
function intersect(a, b, not) {
  return a.filter((c) => {
    const index = ~indexOfDeclaration(b, c);
    return not ? !index : index;
  });
}
187433
def intersection(self, other):
        
        ivs = set()
        shorter, longer = sorted([self, other], key=len)
        for iv in shorter:
            if iv in longer:
                ivs.add(iv)
        return IntervalTree(ivs)
168663
def has_intersection(self, other):
        
        return bool(lib.SDL_HasIntersection(self._ptr, other._ptr))
386668
def intersection(fake_title, unit):
    
    same = 0
    for i in fake_title:
        if i in unit:
            same += 1
    return same
9546
def intersect(self, other):
        """"""
        if self.overlaps(other):
            newlower_value = max(self.lower_value, other.lower_value)
            new_upper_value = min(self._upper_value, other._upper_value)
            new_lower, new_upper = self._get_new_lower_upper(other, self.intersect)
            return Interval(new_lower, newlower_value, new_upper_value, new_upper)
        else:
            return None
928220
public void intersect (Area area) {
        if (area == null) {
            return;
        } else if (isEmpty() || area.isEmpty()) {
            reset();
            return;
        }

        if (isPolygonal() && area.isPolygonal()) {
            intersectPolygon(area);
        } else {
            intersectCurvePolygon(area);
        }

        if (areaBoundsSquare() < GeometryUtil.EPSILON) {
            reset();
        }
    }
448818
function (value) {
                if (this._intersectionThreshold === value) {
                    return;
                }
                this._intersectionThreshold = value;
                if (this.geometry) {
                    this.geometry.boundingBias = new BABYLON.Vector2(0, value);
                }
            }
1058115
def intersection_update(self, other):
        
        ivs = list(self)
        for iv in ivs:
            if iv not in other:
                self.remove(iv)
1034004
def remove_intersecting(self, division, symm=True):
        """"""
        IntersectRelationship.objects.filter(
            from_division=self, to_division=division
        ).delete()
        if symm:
            division.remove_intersecting(self, False)
219393
private Point intersection(int x1, int y1, int x2, int y2, DesktopWindowRect rect) {
    Point
        bottom =
        intersection(x1, y1, x2, y2, rect.getX(), rect.getY(), rect.getX() + rect.getHeight(),
                     rect.getY());
    if (bottom != null) {
      return bottom;
    }

    Point
        right =
        intersection(x1, y1, x2, y2, rect.getX() + rect.getWidth(), rect.getY(),
                     rect.getX() + rect.getWidth(), rect.getY() + rect.getHeight());
    if (right != null) {
      return right;
    }

    Point
        top =
        intersection(x1, y1, x2, y2, rect.getX(), rect.getY() + rect.getHeight(),
                     rect.getX() + rect.getWidth(), rect.getY() + rect.getHeight());
    if (top != null) {
      return top;
    }

    Point
        left =
        intersection(x1, y1, x2, y2, rect.getX(), rect.getY(), rect.getX(),
                     rect.getY() + rect.getHeight());
    if (left != null) {
      return left;
    }

    return null;
  }
163600
public void intersectWith(Intersection<T> arg) {
		// if the argument is top then leave all as is
		if (arg.elements != null) {
			
			// if arg is empty, the result is empty
			if (arg.elements.isEmpty())
				elements = Collections.emptySet();
			else {
				if (elements == null) // we have top, the intersection is sub
					elements = new HashSet<>(arg.elements); // copy the set
				else
					elements.retainAll(arg.elements);							
			}
		}
	}
221741
def intersection(self,other):
        
        res = []
        for i1 in self.ints:
            for i2 in other.ints:
                res.append(i1.intersection(i2))

        return IntervalSet(res)
1152774
def intersection(self, *args):
        '''
        '''
        values = self.values()
        if args:
            values = [val for key,val in self.items() if key in args]
        return set(reduce(set.intersection, values))