Returns all intervals that contain point.
502777
def search_point(self, point, result):
        
        for k in self.s_center:
            if k.begin <= point < k.end:
                result.add(k)
        if point < self.x_center and self[0]:
            return self[0].search_point(point, result)
        elif point > self.x_center and self[1]:
            return self[1].search_point(point, result)
        return result
201699
def points(self):
        
        feature = geojson.Feature(geometry=self._geom)
        points_coords = list(geojson.utils.coords(feature))
        return [Point(p[0], p[1]) for p in points_coords]
978262
function () {
		var points = [];
		each(this.series, function (serie) {
			points = points.concat(grep(serie.points || [], function (point) {
				return point.selected;
			}));
		});
		return points;
	}
850550
def _interval(dates):
        """"""
        interval = (dates[1] - dates[0]).days
        last = dates[0]
        for dat in dates[1:]:
            if (dat - last).days != interval:
                return 0
            last = dat
        return interval
1368615
def pointlist(points, sr):
    """"""
    assert all(isinstance(pt, Point) or len(pt) == 2 
               for pt in points), "Point(s) not in [x, y] form"
    return [coord if isinstance(coord, Point) 
                  else Point(coord[0], coord[1], sr)
            for coord in points]
830631
def within(self, x, ctrs, kdtree=None):
        """"""

        if kdtree is None:
            # If no K-D Tree is provided, execute a brute-force
            # search over all balls.
            idxs = np.where(lalg.norm(ctrs - x, axis=1) <= self.radius)[0]
        else:
            # If a K-D Tree is provided, find all points within `self.radius`.
            idxs = kdtree.query_ball_point(x, self.radius, p=2.0, eps=0)

        return idxs
1258829
private boolean contains(Vector3f test, List<Vector3f> points) {
        int i;
        int j;
        boolean result = false;
        for (i = 0, j = points.size() - 1; i < points.size(); j = i++) {
            if (((points.get(i).z > test.z) != (points.get(j).z > test.z))
                    && (test.x < (points.get(j).x - points.get(i).x)
                    * (test.z - points.get(i).z) / (points.get(j).z - points.get(i).z)
                    + points.get(i).x)) {
                result = !result;
            }
        }
        return result;
    }
476604
def peak_interval(data, alpha=_alpha, npoints=_npoints):
    
    peak = kde_peak(data,npoints)
    x = np.sort(data.flat); n = len(x)
    # The number of entries in the interval
    window = int(np.rint((1.0-alpha)*n))
    # The start, stop, and width of all possible intervals
    starts = x[:n-window]; ends = x[window:]
    widths = ends - starts
    # Just the intervals containing the peak
    select = (peak >= starts) & (peak <= ends)
    widths = widths[select]
    if len(widths) == 0:
        raise ValueError('Too few elements for interval calculation')
    min_idx = np.argmin(widths)
    lo = x[min_idx]
    hi = x[min_idx+window]
    return interval(peak,lo,hi)
245256
def interval_overlap(a, b, x, y):
    """"""
    if b <= x or a >= y:
        return 0
    elif x <= a <= y:
        return min(b, y) - a
    elif x <= b <= y:
        return b - max(a, x)
    elif a >= x and b <= y:
        return b - a
    else:
        assert False
1150849
def qry_coords(self):
        ''''''
        return pyfastaq.intervals.Interval(min(self.qry_start, self.qry_end), max(self.qry_start, self.qry_end))
1348339
def contains_at(self, x, index):
        """"""

        try:
            if is_collection(x):
                for _x in x:
                    if (_x in self.all[index]) or (_x == self.all[index]):
                        return True
                    else:
                        return False
            else:
                return (x in self.all[index])

        except IndexError:
            return False
889113
protected function find_intervals($interval)
    {
        if ($interval instanceof RangeInterface) {
            $first = $interval->getStart();
            $last = $interval->getEnd();
        } else {
            $first = $interval;
            $last = null;
        }

        if (null === $last) {
            $result = $this->point_search($this->top_node, $first);
        } else {
            $result = array();
            foreach ($interval->iterable() as $j) {
                $result = array_merge($result, $this->find_intervals($j));
            }
        }

        return $result;
    }
131686
def find(self, start, end):
        """"""
        if self.intervals and not end < self.intervals[0].start:
            overlapping = [i for i in self.intervals if i.end >= start
                                                    and i.start <= end]
        else:
            overlapping = []

        if self.left and start <= self.center:
            overlapping += self.left.find(start, end)

        if self.right and end >= self.center:
            overlapping += self.right.find(start, end)

        return overlapping
1203069
private function getIntervals()
    {
        $intervals = [];

        foreach ($this->getFilter()->getItems() as $item) {
            $intervals[] = ['value' => $item->getValue(), 'count' => $item->getCount()];
        }

        return $intervals;
    }
219292
def contains(self, point):
    
    return (
          point[0] >= self.minpt[0] 
      and point[1] >= self.minpt[1]
      and point[2] >= self.minpt[2] 
      and point[0] <= self.maxpt[0] 
      and point[1] <= self.maxpt[1]
      and point[2] <= self.maxpt[2]
    )
1291083
private Interval1D<K> search(Node<K, V> x, Interval1D<K> interval) {
    while (x != null) {
      if (interval.intersects(x.interval)) {
        return x.interval;
      } else if (x.left == null) {
        x = x.right;
      } else if (x.left.max.compareTo(interval.lo) < 0) {
        x = x.right;
      } else {
        x = x.left;
      }
    }
    return null;
  }
882322
function getIntervals(ctx) {
  return ctx._intervals || (ctx._parent ? getIntervals(ctx._parent) : new Intervals());
}