Pushes illegal seasons ints into the next/previous year.
495940
def _season_overflow(season, moved_year, now):
    """"""

    if season > 4:
        while season > 4:
            if moved_year is None:
                moved_year = now.year + 1
            else:
                moved_year += 1
            season -= 5
    elif season < 0:
        while season < 0:
            if moved_year is None:
                moved_year = now.year - 1
            else:
                moved_year -= 1
            season += 5
    return season, moved_year
1200814
private void applyHorizontalLimit()
    {
        if (mover.getX() < limitLeft && limitLeft != Integer.MIN_VALUE)
        {
            mover.teleportX(limitLeft);
        }
        else if (mover.getX() > limitRight && limitRight != Integer.MAX_VALUE)
        {
            mover.teleportX(limitRight);
        }
    }
1342099
def year(columns, name=None):
    

    if columns < 0:
        # Can't have negative size
        raise BaseException()

    field = numeric(columns, name)

    # Parse action
    field.addParseAction(_to_year)

    return field
464353
public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max, final long seed) {
        return new YearRangeRandomizer(min, max, seed);
    }
322024
public function withYear(int $year) : YearMonth
    {
        if ($year === $this->year) {
            return $this;
        }

        Field\Year::check($year);

        return new YearMonth($year, $this->month);
    }
633492
public static function check(int $year) : void
    {
        if ($year < self::MIN_VALUE || $year > self::MAX_VALUE) {
            throw DateTimeException::fieldNotInRange(self::NAME, $year, self::MIN_VALUE, self::MAX_VALUE);
        }
    }
1283776
public void not() {
        IntBitSet tmp;

        tmp = new IntBitSet();
        tmp.addRange(0, used - 1);
        tmp.removeAll(ends);
        ends = tmp;
    }
204077
def season_id(x):
    
    if len(str(x)) == 4:
        try:
            return "".join(["2", str(x)])
        except ValueError:
            raise ValueError("Enter the four digit year for the first half of the desired season")
    else:
        raise ValueError("Enter the four digit year for the first half of the desired season")
152050
def get_games_by_season(self, season):
        
        try:
            season = int(season)
        except ValueError:
            raise FantasyDataError('Error: Invalid method parameters')

        result = self._method_call("Games/{season}", "stats", season=season)
        return result
567680
public CalendarYear minus(Years<CalendarUnit> years) {

        if (years.isEmpty()) {
            return this;
        }

        return CalendarYear.of(MathUtils.safeSubtract(this.year, years.getAmount()));

    }
270042
private long newYearInSui(long utcDays) {
        long s1 = this.winterOnOrBefore(utcDays);
        long s2 = this.winterOnOrBefore(s1 + 370);
        long m12 = this.newMoonOnOrAfter(s1 + 1);
        long m13 = this.newMoonOnOrAfter(m12 + 1);
        long nextM11 = this.newMoonBefore(s2 + 1);

        if ((lunations(m12, nextM11) == 12) && (this.hasNoMajorSolarTerm(m12) || this.hasNoMajorSolarTerm(m13))) {
            return this.newMoonOnOrAfter(m13 + 1);
        } else {
            return m13;
        }
    }
1051754
@Deprecated
    protected int handleGetExtendedYear() {
        int eyear;
        if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
            eyear = internalGet(EXTENDED_YEAR, 1); // Default to year 1
        } else {
            // The year defaults to the epoch start, the era to AD
            int era = internalGet(ERA, CE);
            if (era == BCE) {
                eyear = 1 - internalGet(YEAR, 1); // Convert to extended year
            } else {
                eyear = internalGet(YEAR, 1); // Default to year 1
            }
        }
        return eyear;
    }
596034
def _get_season(_datetime: typing.Optional[date] = None) -> typing.Tuple[str, int]:
    
    if _datetime is None:
        _actual_datetime: date = datetime.now().date().replace(year=Y)
    else:
        _actual_datetime = _datetime.replace(year=Y)
    return next((season, temp) for season, temp, (start, end) in SEASONS if start <= _actual_datetime <= end)
313941
public function addValidYear( $year )
	{
		if ( is_array( $year ) )
		{
			$this->validYears += $year;
		}
		elseif ( $year !== null )
		{
			$this->validYears[] = $year;
		}
	}
492585
private void construct(int _raw,
                           int _startMonth,
                           int _startDay,
                           int _startDayOfWeek,
                           int _startTime,
                           int _startTimeMode,
                           int _endMonth,
                           int _endDay,
                           int _endDayOfWeek,
                           int _endTime,
                           int _endTimeMode,
                           int _dst) {
        raw            = _raw;
        startMonth     = _startMonth;
        startDay       = _startDay;
        startDayOfWeek = _startDayOfWeek;
        startTime      = _startTime;
        startTimeMode  = _startTimeMode;
        endMonth       = _endMonth;
        endDay         = _endDay;
        endDayOfWeek   = _endDayOfWeek;
        endTime        = _endTime;
        endTimeMode    = _endTimeMode;
        dst            = _dst;
        startYear      = 0;
        startMode      = DOM_MODE;
        endMode        = DOM_MODE;

        decodeRules();

        if (_dst <= 0) {
            throw new IllegalArgumentException();
        }
    }
1053599
public function plusYears(int $years) : YearMonth
    {
        if ($years === 0) {
            return $this;
        }

        return $this->withYear($this->year + $years);
    }
723962
private boolean advanceYear(Calendar cal, int year)
    {
        year = years.nextSetBit(year + 1 - ScheduleExpressionParser.MINIMUM_YEAR); // d665298
        if (year >= 0)
        {
            cal.set(Calendar.YEAR, year + ScheduleExpressionParser.MINIMUM_YEAR); // d665298
            return true;
        }

        return false;
    }