Returns True if the difference between date and any value in dates
        is less than or equal to limit.
323925
def is_within_limits(self, limit, date, dates):
        
        return any((self.second_diff(date, d) <= limit for d in dates))
1042242
public static boolean between(float value, float start, float end) {
        if (start > end) {
            float tmp = start;
            start = end;
            end = tmp;
        }
        return value >= start && value <= end;
    }
1101728
public boolean isWithin(Date date) {
		if(first == null) {
			return false;
		} else if(date.equals(first)) {
			return true;
		} else if(date.equals(last)) {
			return true;
		} else if(date.after(first) && date.before(last)) {
			return true;
		} else {
			return false;
		}
	}
489584
private static long daysBetween(Date date1, Date date2) {
        long diff;
        if (date2.after(date1)) {
            diff = date2.getTime() - date1.getTime();
        } else {
            diff = date1.getTime() - date2.getTime();
        }
        return diff / (24 * 60 * 60 * 1000);
    }
550876
def isconsistent(self):
        ''''''
        for dt1, dt0 in laggeddates(self):
            if dt1 <= dt0:
                return False
        return True
1148889
public boolean isRangeSet() {
		for (int i = 0; i < getDimensions(); i++) {
			if( valueMin[i] == 0 && valueMax[i] == 0 ) {
				return false;
			}
		}

		return true;
	}
408485
private boolean isTimeAfterOrEquals(Calendar time1, Calendar time2) {
        return !(time1 == null || time2 == null) && time1.getTimeInMillis() >= time2.getTimeInMillis();
    }
1350088
public static boolean isBetween(@NotNull final Date date, @NotNull final Date start, @NotNull final Date end) {
		if (date == null || start == null || end == null || start.after(end)) {
			throw new IllegalArgumentException("some date parameters is null or dateBein after dateEnd");
		}
		return !date.before(start) && !date.after(end);
	}
1221165
public boolean inGivenDay(Date theGivenDate) {
		Date[] givenDay = of(theGivenDate).asDayRange();
		return this.target.compareTo(givenDay[0]) >= 0 && this.target.compareTo(givenDay[1]) <= 0;
	}
1113120
def date_matches(self, timestamp):
        """"""
        if self.date is None:
            return False

        timestamp = datetime.fromtimestamp(float(timestamp), self.timezone)
        if self.date.date() == timestamp.date():
            return True

        return False
469701
def validate_DATERANGE(value, restriction):
    
    if len(restriction) != 2:
        raise ValidationError("Template ERROR: Only two values can be specified in a date range.")

    if type(value) == pd.DataFrame:
        dates = [get_datetime(v) for v in list(value.index)]
    else:
        dates = value

    if type(dates) is list:
        for date in dates:
            validate_DATERANGE(date, restriction)
        return

    min_date = get_datetime(restriction[0])
    max_date = get_datetime(restriction[1])
    if value < min_date or value > max_date:
        raise ValidationError("DATERANGE: %s <%s> %s"%(min_date,value,max_date))
893912
public boolean isIn(Date beginDate, Date endDate) {
		long beginMills = beginDate.getTime();
		long endMills = endDate.getTime();
		long thisMills = this.getTime();

		return thisMills >= Math.min(beginMills, endMills) && thisMills <= Math.max(beginMills, endMills);
	}
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
989116
private static boolean checkDate(Calendar cal, int date, int month) {
		return cal.get(Calendar.DATE) == date && cal.get(Calendar.MONTH) == month;
	}
622880
private int compareDate(Date a, Date b) {
		final Date ta = new Date(a.getTime());
		final Date tb = new Date(b.getTime());
		final long d1 = setHourToZero(ta).getTime();
		final long d2 = setHourToZero(tb).getTime();
		return (int) Math.round((d2 - d1) / 1000.0 / 60.0 / 60.0 / 24.0);
	}
422056
public function isDatesValid()
    {
        if ($this->startDate >= $this->endDate) {
            return false;
        }

        return ($this->endDate->diff($this->startDate)->days > 0);
    }
245692
def sub_match?(time, accessor, values)

      return true if values.nil?

      value = time.send(accessor)

      if accessor == :day

        values.each do |v|
          return true if v == 'L' && (time + DAY_S).day == 1
          return true if v.to_i < 0 && (time + (1 - v) * DAY_S).day == 1
        end
      end

      if accessor == :hour

        return true if value == 0 && values.include?(24)
      end

      if accessor == :monthdays

        return true if (values & value).any?
      end

      values.include?(value)
    end