Return a lambda function.

    Lambda checks that either the original day does not fall on a given
    weekday, or that the replacement day does fall on the expected weekday.
321633
def move_if_not_on_dow(original, replacement, dow_not_orig, dow_replacement):
    
    return lambda x: (
        (x.hdate.day == original and x.gdate.weekday() != dow_not_orig) or
        (x.hdate.day == replacement and x.gdate.weekday() == dow_replacement))
326262
def search_weekday(weekday, jd, direction, offset):
    ''''''
    return weekday_before(weekday, jd + (direction * offset))
1031429
function () {
      var i;
      for (i = 0; i < arguments.length; i++) {
         if (!this.is_lambda_scheduled(arguments[i])) {
            return false;
         }
      }
      return true;
   }
1167872
def iso_day_to_weekday(d):
    
    if int(d) == utils.get_now().isoweekday():
        return _("today")
    for w in WEEKDAYS:
        if w[0] == int(d):
            return w[1]
1183555
function weekNumber(d, firstWeekday) {
		firstWeekday = firstWeekday || 'sunday';
		// This works by shifting the weekday back by one day if we
		// are treating Monday as the first day of the week.
		var wday = d.getDay();
		if (firstWeekday == 'monday') {
			if (wday == 0) // Sunday
				wday = 6;
			else
				wday--;
		}
		var firstDayOfYear = new Date(d.getFullYear(), 0, 1)
			, yday = (d - firstDayOfYear) / 86400000
			, weekNum = (yday + 7 - wday) / 7
			;
		//    return Math.floor(weekNum);
		return weekNum | 0;
	}
420616
public Weekday getDayOfWeek() {

        Weekday dow = this.weekday;

        if (dow == null) {
            dow = Weekday.valueOf(GregorianMath.getDayOfWeek(this.year, this.month, this.dayOfMonth));
        }

        return dow;

    }
505281
def weekdays(first_day=None):
    
    if first_day is None:
        first_day = 'Monday'
    ix = _lower_weekdays().index(first_day.lower())
    return _double_weekdays()[ix:ix+7]
634415
def prev_weekday(weekday):
    """"""
    ix = WEEKDAYS.index(weekday)
    if ix == 0:
        return WEEKDAYS[len(WEEKDAYS)-1]
    return WEEKDAYS[ix-1]
1093399
def get_last_weekday_in_month(year, month, weekday):
        
        day = date(year, month, monthrange(year, month)[1])
        while True:
            if day.weekday() == weekday:
                break
            day = day - timedelta(days=1)
        return day
1256666
def rec_apply(func, n):
    
    if n > 1:
        rec_func = rec_apply(func, n - 1)
        return lambda x: func(rec_func(x))
    return func
781231
def previous_week_day(base_date, weekday):
    
    day = base_date - timedelta(days=1)
    while day.weekday() != weekday:
        day = day - timedelta(days=1)
    return day
22789
def weekend_to_monday(dt):
    
    if dt.weekday() == 6:
        return dt + timedelta(1)
    elif dt.weekday() == 5:
        return dt + timedelta(2)
    return dt
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
647443
def find_following_working_day(self, day):
        
        day = cleaned_date(day)

        while day.weekday() in self.get_weekend_days():
            day = day + timedelta(days=1)
        return day
638023
def _ssweek_of_month(date_value):
    ""
    weekday_of_first = (date_value.replace(day=1).weekday() + 1) % 7
    return (date_value.day + weekday_of_first - 1) // 7
395751
def weekday_tomorrow(self, date_from=None, date_format=None):
		
		# date de demain que sur les jours de semaine
		return self.delta(days=1, date_from=date_from, date_format=date_format, days_range=[1, 2, 3, 4, 5])
217600
function partial( lambda ) {

	/**
	* FUNCTION: mgf( t )
	*	Evaluates the moment-generating function (MGF) for an exponential distribution.
	*
	* @private
	* @param {Number} t - input value
	* @returns {Number} evaluated MGF
	*/
	return function mgf( t ) {
		if ( t >= lambda ) {
			return NaN;
		}
		return lambda / ( lambda - t );
	};
}