check jalali the instance is a leap year

@param int $year
@return bool
541700
public static function isLeapYear($year) {
	    $mod = ($year % 33);
	    if (($mod == 1) or ( $mod == 5) or ( $mod == 9) or ( $mod == 13) or ( $mod == 17) or ( $mod == 22) or ( $mod == 26) or ( $mod == 30)) {
	        return true;
	    }
	    return false;
	}
846447
public function withYear(int $year): DateTime
    {
        return new static(
            Date::create($year, $this->month(), $this->day()),
            $this->time(),
            $this->timezone()
        );
    }
971889
function(month, year1, year2) {
    var leap1 = isLeap(year1 - 1);
    var leap2 = isLeap(year2 - 1);

    if(month < 5 + leap1) return 0;
    return leap2 - leap1;
  }
16698
public function getHolidaysByYear($year)
    {
        $easter = $this->getEasterDates($year);

        $greatPrayerDay = clone $easter['easterSunday'];
        $greatPrayerDay->modify('+26 days');

        $holidays = array(
            '01-01' => $this->createData('Nytår'),
            '12-25' => $this->createData('1. Juledag'),
            '12-26' => $this->createData('2. Juledag'),

            // Variable dates
            $easter['maundyThursday']->format(self::DATE_FORMAT)  => $this->createData('Skærtorsdag'),
            $easter['goodFriday']->format(self::DATE_FORMAT)      => $this->createData('Langfredag'),
            $easter['easterSunday']->format(self::DATE_FORMAT)    => $this->createData('Påskedag'),
            $easter['easterMonday']->format(self::DATE_FORMAT)    => $this->createData('2. Påskedag'),
            $greatPrayerDay->format(self::DATE_FORMAT)            => $this->createData('Store Bededag'),
            $easter['ascensionDay']->format(self::DATE_FORMAT)    => $this->createData('Kristi Himmelfartsdag'),
            $easter['pentecostSunday']->format(self::DATE_FORMAT) => $this->createData('Pinsedag'),
            $easter['pentecostMonday']->format(self::DATE_FORMAT) => $this->createData('2. Pinsedag')
        );

        return $holidays;
    }
1270767
protected static function isArithmeticLeapYear($year, $yearIsInGeorgian = false) {
        
        // a change for fit
        if ( ! $yearIsInGeorgian) {
            $year += static::HEGIRA_STARTING_YEAR;
        }
        
        $yearPositionInQuadCycle = static::calculateYearInQuadCycle($year) - 1;
        
        $arithmeticBreakPoints = [
            29,
            62,     // (29 + 33)
            95,     // (29 + 33 + 33)
            128,    // (29 + 33 + 33 + 33)
        ];
        
        foreach ($arithmeticBreakPoints as $i => $break) {
            if (isset($arithmeticBreakPoints[$i + 1])) {
                $nextBreak = $arithmeticBreakPoints[$i + 1];
                if ($yearPositionInQuadCycle >= $break && $yearPositionInQuadCycle < $nextBreak) {
                    $yearPositionInQuadCycle -= $break;
                    break;
                }
            }
        }
        
        // the first year is always a common year
        // other years whose ordinal numbers are divisible by 4 are leap years
        $isLeapYear = false;
        if ($yearPositionInQuadCycle != 0 && ($yearPositionInQuadCycle % 4) == 0) {
            $isLeapYear = true;
        }
        
        return $isLeapYear;
    }
1172063
protected function yearOrYearNo($year)
    {
        if (is_scalar($year)) {
            return $this->getYear($year);
        }

        if (!$year instanceof Year) {
            throw new InvalidArgumentException(
                '$year must be an instance of BmCalendar\Year; got "' . get_class($year) . '"'
            );
        }

        return $year;
    }
19927
public static function year($year = null)
	{
		$from = DateTime::create(1, 1, $year);
		$till = $from->copy()->addYears(1)->addDays(-1);
		return new Calendar($from, $till);
	}
378603
public static function firstSundayOfYear($year = null)
    {
        $year = $year ? (int) $year : Date('Y');
        $sunday = Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);
        return ((int) $sunday->format('Y') === $year) ? $sunday : $sunday->addDays(7);
    }
541608
public static function getFirstOfYear($year='')
    {
        if ($year == '')
        {
            $currentTime = time();
            $year = date('Y', $currentTime);
        }
        
        $timestamp = mktime(0, 0, 0, $month=1, $day=1, $year);
        
        return $timestamp;
    }
1347182
public function getMonths($year)
    {
        $year = $this->yearOrYearNo($year);

        $months = array();

        for ($monthNo = 1; $monthNo <= 12; $monthNo++) {
            $months[$monthNo] = new Month($year, $monthNo);
        }

        return $months;
    }
762876
protected function yToJd($year)
    {
        $div19 = (int) (($year - 1) / 19);
        $mod19 = ($year - 1) % 19;

        $months      = 235 * $div19 + 12 * $mod19 + (int) ((7 * $mod19 + 1) / 19);
        $parts       = 204 + 793 * ($months % 1080);
        $hours       = 5 + 12 * $months + 793 * (int) ($months / 1080) + (int) ($parts / 1080);
        $conjunction = 1080 * ($hours % 24) + ($parts % 1080);
        $julian_day  = 1 + 29 * $months + (int) ($hours / 24);

        if ($conjunction >= 19440 ||
            $julian_day % 7 === 2 && $conjunction >= 9924 && !$this->isLeapYear($year) ||
            $julian_day % 7 === 1 && $conjunction >= 16789 && $this->isLeapYear($year - 1)
        ) {
            $julian_day++;
        }

        // The actual year start depends on the day of the week
        return $julian_day + self::$ROSH_HASHANAH[$julian_day % 7];
    }
250691
public static boolean isLeapYear(int y) {
		boolean result = false;

		if (((y % 4) == 0) && // must be divisible by 4...
				((y < 1582) || // and either before reform year...
						((y % 100) != 0) || // or not a century...
						((y % 400) == 0))) { // or a multiple of 400...
			result = true; // for leap year.
		}
		return result;
	}
1236585
def is_this_year(self):
        """"""
        return is_current_year(datetime.datetime.combine(self.date, datetime.time()))
1071977
private static function calculateGrandCycle($year) {
        
        $endOfFirstGrandCycle = static::GRAND_CYCLE_BEGINNING + static::GRAND_CYCLE_LENGTH;
        
        // by default we are in the first grand cycle
        $grandCycle = 0;
        if ($year < static::GRAND_CYCLE_BEGINNING) {
            
            $beginningYear = static::GRAND_CYCLE_BEGINNING;
            while ($year < $beginningYear) {
                $beginningYear -= static::GRAND_CYCLE_LENGTH;
                $grandCycle--;
            }
            
        } elseif ($year >= $endOfFirstGrandCycle) {
            
            $beginningYear = $endOfFirstGrandCycle;
            while ($year >= $beginningYear) {
                $beginningYear += static::GRAND_CYCLE_LENGTH;
                $grandCycle++;
            }
        }
        
        return $grandCycle;
    }
1096095
public function addYears($years)
    {
        $years = (int) $years;
        $interval = new DateInterval('P' . abs($years) . 'Y');

        if ($years < 0) {
            $interval->invert = 1;
        }

        return $this->add($interval);
    }
919677
public static function gregorianToJd($month, $day, $year)
    {
        if ($year == 0) {
            return 0;
        } else {
            return self::$gregorian_calendar->ymdToJd($year, $month, $day);
        }
    }
414231
function(year) {
			var date = this._validate(year, this.minMonth, this.minDay,
				$.calendars.local.invalidYear || $.calendars.regionalOptions[''].invalidYear);
			return (date.year() < 0 ? this.local.epochs[0] : this.local.epochs[1]);
		}