Avoid a situation to "open" a new currentInterval for pair of same-side equals bounds like: x], x]
174139
private static boolean canBeNewCurrInterval(Bound<?> lastBound, Bound<?> currentBound) {
        int vCompare = BoundValueComparator.compareValueDispatchingToInf(lastBound, currentBound);
        if (vCompare != 0) {
            return true;
        } else {
            if (lastBound.isLowerBound() && currentBound.isUpperBound()) {
                return true;
            } else if (lastBound.isUpperBound() && lastBound.getBoundaryType() == RangeBoundary.OPEN 
                && currentBound.isLowerBound() && currentBound.getBoundaryType() == RangeBoundary.OPEN) {
                return true; // the case x) (x
            } else {
                return false;
            }
        }
    }
232310
def CreateStridedInterval(name=None, bits=0, stride=None, lower_bound=None, upper_bound=None, uninitialized=False,
                          to_conv=None, discrete_set=False, discrete_set_max_cardinality=None):
    
    if to_conv is not None:
        if isinstance(to_conv, Base):
            to_conv = to_conv._model_vsa
        if isinstance(to_conv, StridedInterval):
            # No conversion will be done
            return to_conv

        if not isinstance(to_conv, (numbers.Number, BVV)):
            raise ClaripyOperationError('Unsupported to_conv type %s' % type(to_conv))

        if (stride is not None
            or lower_bound is not None
            or upper_bound is not None):
            raise ClaripyOperationError('You cannot specify both to_conv and other parameters at the same time.')

        if isinstance(to_conv, BVV):
            bits = to_conv.bits
            to_conv_value = to_conv.value
        else:
            bits = bits
            to_conv_value = to_conv

        stride = 0
        lower_bound = to_conv_value
        upper_bound = to_conv_value

    bi = StridedInterval(name=name,
                         bits=bits,
                         stride=stride,
                         lower_bound=lower_bound,
                         upper_bound=upper_bound,
                         uninitialized=uninitialized)
    if not discrete_set:
        return bi
    else:
        dsis = DiscreteStridedIntervalSet(
            name=name,
            bits=bits,
            si_set={ bi },
            max_cardinality=discrete_set_max_cardinality
        )

        return dsis
290852
def addinterval(instr, add, interval):
    '''
        
    '''
    if not isinstance(instr, str):
        instr = str(instr)

    return add.join(
        instr[i:i+interval]
        for i in xrange(0,len(instr),interval))
652290
function(){

            var isX
                ,hash
                ,tr1
                ,tr2
                ,bound
                ,list
                ,len
                ,i
                ,j
                ,c
                // determine which axis is the last we need to check
                ,collisionFlag = 1 << (dof.z + 1) << (dof.y + 1) << (dof.x + 1)
                ,encounters = this.encounters
                ,enclen = 0
                ,candidates = this.candidates
                ;

            Physics.util.clearArray( encounters );
            Physics.util.clearArray( candidates );

            for ( var xyz = 0; xyz < maxDof; ++xyz ){

                // is the x coord
                isX = (xyz === 0);
                // get the interval list for this axis
                list = this.intervalLists[ xyz ];

                // for each interval bound
                for ( i = 0, len = list.length; i < len; i++ ){

                    bound = list[ i ];
                    tr1 = bound.tracker;

                    if ( bound.type ){

                        // is a max

                        j = enclen;

                        for ( j = enclen - 1; j >= 0; j-- ){

                            tr2 = encounters[ j ];

                            // if they are the same tracked interval
                            if ( tr2 === tr1 ){

                                // remove the interval from the encounters list
                                // faster than .splice()
                                if ( j < enclen - 1 ) {

                                    encounters[ j ] = encounters.pop();

                                } else {

                                    // encountered a max right after a min... no overlap
                                    encounters.pop();
                                }

                                enclen--;

                            } else {

                                // check if we have flagged this pair before
                                // if it's the x axis, create a pair
                                c = this.getPair( tr1, tr2, isX );

                                if ( c && c.flag < collisionFlag ){

                                    // if it's greater than the axis index, set the flag
                                    // to = 0.
                                    // if not, increment the flag by one.
                                    c.flag = c.flag << (xyz + 1);

                                    // c.flag will equal collisionFlag
                                    // if we've incremented the flag
                                    // enough that all axes are overlapping
                                    if ( c.flag === collisionFlag ){

                                        // overlaps on all axes.
                                        // add it to possible collision
                                        // candidates list for narrow phase

                                        candidates.push( c );
                                    }
                                }
                            }
                        }

                    } else {

                        // is a min
                        // just add this minimum to the encounters list
                        enclen = encounters.push( tr1 );
                    }
                }
            }

            return candidates;
        }
367699
function resetPolling(newIntervalInMinutes) {
    if (pollTimerID != null) {
        clearTimeout(pollTimerID);
    }
    pollTimerID = null;
    if (newIntervalInMinutes == null) {
        const settings = pi.setting.getSettings();
        newIntervalInMinutes = settings.Periodical.pollInterval;
    }
    if (typeof newIntervalInMinutes == 'number') {
        const curDate = new Date();
        // Align by nearest hour
        const alignedDate = new Date(
            curDate.getFullYear(), curDate.getMonth(), curDate.getDate(), curDate.getHours());
        const millisDiff = curDate.getTime() - alignedDate.getTime();
        let nextTiming = 0;
        while (nextTiming < millisDiff) {
            nextTiming += newIntervalInMinutes * 60*1000;
        }
        if (nextTiming >= 60*60*1000) {
            nextTiming = 60*60*1000;
        }
        pollTimerID
            = setTimeout(runPollScript
                , nextTiming - millisDiff + 1000 /* margin*/);
    }
}
50347
function Interval(sourceString, startIdx, endIdx) {
  this.sourceString = sourceString;
  this.startIdx = startIdx;
  this.endIdx = endIdx;
}
755984
private boolean isOutOrBelow(Context current)
	{
		Context c = current.threadState.outctxt;

		while (c != null)
		{
			if (c == current)
			{
				return true;
			}
			c = c.outer;
		}

		return false;
	}
218767
function it_leavesNewVertexWithNewValue() {
			it("leaves a new vertex in the graph with a new value", function () {
				callItWith('newKey', 'newValue');
				expect(graph.hasVertex('newKey')).toBeTruthy();
				expect(graph.vertexValue('newKey')).toBe('newValue');
				expect(graph.vertexCount()).toBe(originalVertexCount + 1);
			});
		}
533603
public boolean removeInterval(Bounds i) {
		if(bs.remove(i)) {
			Bounds intersection = new Bounds(0, APSPSolver.INF);
			
			for(Bounds toIntersect : bs) {
				//intersection = intervalIntersect(intersection, toIntersect);//intervalIntersect(intersection, inter);
				intersection = intersection.intersect(toIntersect);
			}
					
			minimum = intersection.min;
			maximum = intersection.max;
			
			return true;
		}
		return false;
	}
1033355
def restrict(self,subinterval):
        
        if (subinterval[0] < self._domain[0]) or (subinterval[1] > self._domain[1]):
            raise ValueError("Can only restrict to subinterval")
        return self.from_function(self, subinterval)
9202
def _timestamp_instants_eq(a, b):
    """"""
    assert isinstance(a, datetime)
    if not isinstance(b, datetime):
        return False
    # datetime's __eq__ can't compare a None offset and a non-None offset. For these equivalence semantics, a None
    # offset (unknown local offset) is treated equivalently to a +00:00.
    if a.tzinfo is None:
        a = a.replace(tzinfo=OffsetTZInfo())
    if b.tzinfo is None:
        b = b.replace(tzinfo=OffsetTZInfo())
    # datetime's __eq__ implementation compares instants; offsets and precision need not be equal.
    return a == b
467197
function intersectStepAbove([entry]) {
    updateDirection();
    const { isIntersecting, boundingClientRect, target } = entry;

    // bottom = bottom edge of element from top of viewport
    // bottomAdjusted = bottom edge of element from trigger
    const { top, bottom } = boundingClientRect;
    const topAdjusted = top - offsetMargin;
    const bottomAdjusted = bottom - offsetMargin;
    const index = getIndex(target);
    const ss = stepStates[index];

    // entering above is only when topAdjusted is negative
    // and bottomAdjusted is positive
    if (
      isIntersecting &&
      topAdjusted <= 0 &&
      bottomAdjusted >= 0 &&
      direction === 'down' &&
      ss.state !== 'enter'
    )
      notifyStepEnter(target, direction);

    // exiting from above is when topAdjusted is positive and not intersecting
    if (
      !isIntersecting &&
      topAdjusted > 0 &&
      direction === 'up' &&
      ss.state === 'enter'
    )
      notifyStepExit(target, direction);
  }
31251
public boolean isIntervalComparable(Interval<E> other)
  {
    int flags = getRelationFlags(other);
    if (checkMultipleBitSet(flags & REL_FLAGS_INTERVAL_UNKNOWN)) {
      return false;
    }
    return checkFlagSet(flags, REL_FLAGS_INTERVAL_BEFORE) || checkFlagSet(flags, REL_FLAGS_INTERVAL_AFTER);
  }
229875
@Override
    ChronoInterval<Moment> newInterval(
        Boundary<Moment> start,
        Boundary<Moment> end
    ) {

        return MomentIntervalFactory.INSTANCE.between(start, end);

    }
1331370
def getInterval(self, alpha):
        
        dlnl = twosided_cl_to_dlnl(1.0 - alpha)
        lo_lim = self.getDeltaLogLike(dlnl, upper=False)
        hi_lim = self.getDeltaLogLike(dlnl, upper=True)
        return (lo_lim, hi_lim)
705409
function loopThroughHandlers(lastFuture, n) {
            if(n < routes.length) {
                var route = routes[n].route
                var handler = route[handlerProperty]

                if(direction === -1) {
                    var originalIndexFromCurrentRoutes = currentRoutes.length - n - 1
                    var distance = routes.length - n        // divergenceDistance
                } else {
                    var originalIndexFromCurrentRoutes = routeVergenceIndex+n
                    var distance = undefined                // no more leafDistance: routes.length - n - 1    // leafDistance
                }

                return lastFuture.then(function() {
                    if(handler !== undefined) {
                        if(originalIndexFromCurrentRoutes > 0) {
                            var parentRoute = currentRoutes[originalIndexFromCurrentRoutes-1]
                            var lastValue = parentRoute.route.lastValue
                        }

                        var nextFuture = handler.call(route, lastValue, distance)
                        if(nextFuture !== undefined) {
                            nextFuture.then(function(value) {
                                route.lastValue = value
                            }) // no done because nextFuture's errors are handled elsewhere
                        }
                    }

                    if(nextFuture === undefined) {
                        nextFuture = Future(undefined)
                    }

                    return loopThroughHandlers(nextFuture, n+1)

                }).catch(function(e){
                    return handleError(currentRoutes, originalIndexFromCurrentRoutes, type, e, []).then(function() {
                        if(direction === 1) {
                            return Future(n + routeVergenceIndex)
                        } else { // -1 exit handlers
                            return loopThroughHandlers(Future(undefined), n+1)  // continue executing the parent exit handlers
                        }
                    })
                })
            } else {
                return lastFuture.then(function() {
                    return Future(n + routeVergenceIndex)
                }).catch(function(e) {
                    throw e // propagate the error not the value
                })
            }
        }
330223
synchronized boolean removeInterval(Interval i) {
        calcMinDuration = null;
        calcMaxDuration = null;
        calcMinFinish = null;
        calcMaxFinish = null;
        calcMinStart = null;
        calcMaxStart = null;
        shortestDistancesFromTimeZeroSource = null;
        shortestDistancesFromTimeZeroDestination = null;

        if (directedGraph.remove(i.getStart()) != null) {
            if (directedGraph.remove(i.getFinish()) == null) {
                throw new IllegalStateException();
            }
            intervals.remove(i);
            return true;
        } else {
            return false;
        }
    }