Checks if the interval overlaps another interval
@param IntervalInterface $interval
@return bool true if overal occurs
552801
public function overlaps(IntervalInterface $interval)
    {
        $startDate = $interval->getStart();
        $endDate   = $interval->getEnd();

        return $this->checkOverlaping($startDate, $endDate);
    }
589312
public function hasUsage(StatusInterface $status)
    {
        /** @var StatusableContainerRepositoryInterface $repository */
        foreach ($this->statusableElementRepositories as $repository) {
            if ($repository->hasStatusedElement($status)) {
                return true;
            }
        }

        return false;
    }
1108002
def overlaps(self, contig, start, end, strand=None):
        
        return (
            self.can_overlap(contig, strand) and
            self.distance_to_interval(start, end) == 0)
620330
public boolean between(final Interval<C> that, final Interval<C> other) {
        checkNotNull(this.range, that.range);
        checkNotNull(other.range);
        return this.after(that) && this.before(other);
    }
1287661
public function encompasses(TimeRange $otherRange) : bool
    {
        return $this->start->isEarlierThanOrEqual($otherRange->start) && $this->end->isLaterThanOrEqual($otherRange->end);
    }
673081
protected function _getInterval($interval) {
		if ($interval !== null) {
			return $interval;
		} elseif (!empty($this->params['interval'])) {
			return $this->params['interval'];
		} else {
			return '1 day';
		}
	}
145612
def overlap(self, other):
        """"""
        if self._start < other.end and self._end > other.start:
            return True
        return False
685023
public boolean overlaps(TimecodeRange that)
	{
		if (this.within(that.getStart()) || this.within(that.getEnd()))
		{
			return true; // we contain one of their timecodes
		}
		else if (that.within(this.getStart()) || that.within(this.getEnd()))
		{
			return true; // they contain one of our timecodes
		}
		else
		{
			return false;
		}
	}
1027827
final public static function intervalToSeconds($interval)
    {
        try {
            $start = new \DateTimeImmutable();
            $end = $start->add($interval);
            return $end->getTimestamp() - $start->getTimestamp();
        } catch (\Exception $e) {
            return 0;
        }

    }
1100632
public function interval($interval = null)
    {
        if (is_null($interval)) {
            return (int) $this->interval;
        }

        $this->interval = (int) $interval;

        return $this;
    }
494882
public static function normalize($interval)
    {
        $from = new \DateTime("1970-01-01 00:00:00");
        $to = clone $from;
        $to = $to->add($interval);
        $result = $from->diff($to);

        return ($result !== false) ? $result : $interval;
    }
817359
protected static function intervalHasTime(DateInterval $interval)
    {
        // The array_key_exists and get_object_vars are used as a workaround to check microsecond support.
        // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug:
        // https://bugs.php.net/bug.php?id=74852
        return $interval->h || $interval->i || $interval->s || array_key_exists('f', get_object_vars($interval)) && $interval->f;
    }
1288441
public function assert(Interval $first, Interval $second): bool
    {
        return $first->getEnd()->lessThan($second->getStart());
    }
905678
public function indexOf(Period $interval)
    {
        foreach ($this->intervals as $offset => $period) {
            if ($period->equals($interval)) {
                return $offset;
            }
        }

        return false;
    }
94299
public function intersects(TimeframeInterface $frame)
    {
        return
            // Checks intersections within:
            ($this->contains($frame->start()) || $this->contains($frame->end()))
            // Checks full overlaps:
            || ($frame->start() <= $this->start && $frame->end() >= $this->end)
        ;
    }
1234780
public function findIntervalics($interval, $scale=null) {
		if (is_null($scale)) {
			$scale = $this->scale;
		}
 		$rotateme = $scale; // make a copy
		return $scale & (BitmaskUtils::rotateBitmask($rotateme, $direction = 1, $amount = $interval));
	}
492172
def is_valid_interval(interval):
    
    if not isinstance(interval, (int, long)):
        return False

    if interval <= 0:
        return False

    return True