Happybirthday::Birtyday initializer
 @param birthday [Date,String] birthday Date or date like String (ex."2018-05-08")
 @return [Happybirthday::Birtyday]
 Judge whether today is birthday or not
 @return [Boolean]
511502
def today?
      today = Date.today
      date.month == today.month && date.day == today.day
    end
1157653
def wholeday(date: datetime.date) -> "Interval":
        
        start = datetime.datetime.combine(date, datetime.time())
        return Interval(
            start,
            start + datetime.timedelta(days=1)
        )
250405
def happybirthday(person):
    
    print('Happy Birthday To You')
    time.sleep(2)
    print('Happy Birthday To You')
    time.sleep(2)
    print('Happy Birthday Dear ' + str(person[0].upper()) + str(person[1:]))
    time.sleep(2)
    print('Happy Birthday To You')
1025582
def get_leapdays(init_date, final_date):
    

    curr_date = init_date
    leap_days = 0

    while curr_date != final_date:

        if curr_date.month == 2 and curr_date.day == 29:
            leap_days += 1

        curr_date += datetime.timedelta(days=1)

    return datetime.timedelta(days=leap_days)
836209
def on(self, day, strict=False):
        
        day_start, day_stop = day.floor('day').span('day')
        if strict:
            return self.included(day_start, day_stop)
        else:
            return self.overlapping(day_start, day_stop)
560837
def get_start_of_day(year, month, day):
    
    # DST is not known in the provided date
    try:
        timestamp = time.mktime((year, month, day, 00, 00, 00, 0, 0, -1))
    except (OverflowError, ValueError):
        # Windows mktime sometimes crashes on (1970, 1, 1, ...)
        timestamp = 0.0

    return int(timestamp)
473587
def is_birthday(self, dt=None):
        
        if dt is None:
            dt = self.now(self.tz)

        instance = pendulum.instance(dt)

        return (self.month, self.day) == (instance.month, instance.day)
169220
def month_days(year, month):
    ''''''
    if month > 13:
        raise ValueError("Incorrect month index")

    # First of all, dispose of fixed-length 29 day months
    if month in (IYYAR, TAMMUZ, ELUL, TEVETH, VEADAR):
        return 29

    # If it's not a leap year, Adar has 29 days
    if month == ADAR and not leap(year):
        return 29

    # If it's Heshvan, days depend on length of year
    if month == HESHVAN and (year_days(year) % 10) != 5:
        return 29

    # Similarly, Kislev varies with the length of year
    if month == KISLEV and (year_days(year) % 10) == 3:
        return 29

    # Nope, it's a 30 day month
    return 30
526173
def >> n
      y, m = (year * 12 + (mon - 1) + n).divmod(12)
      m, = (m + 1) .divmod(1)
      d = mday
      until jd2 = _valid_civil?(y, m, d)
        d -= 1
        raise ArgumentError, 'invalid date' unless d > 0
      end
      self + (jd2 - jd)
    end
954691
function getAge(birthday, when) {
  birthday = this.toDate(birthday);
  when = this.toDate(when || new Date());
  var b = new Date(birthday).setFullYear(2000);
  var w = new Date(when).setFullYear(2000);
  return when.getFullYear() - birthday.getFullYear() - (w >= b ? 0: 1);
}
1208214
private function _checkBirthdayCode($birthdayCode)
    {
        $date = DateTime::createFromFormat($format = 'Ymd', $birthdayCode);

        return $date->format($format) === $birthdayCode && (int) $date->format('Y') >= 1800;
    }
460244
def day_of_year(date = self)
      date.month == 1 ? date.day : (DAYS_IN_YEAR[date.month - 2] + date.day)
    end
497778
def date(self, *args, **kwargs):
        
        compare = Date(*args, **kwargs)
        self.add(compare)

        return self
1183691
def date_this_year(self, before_today=True, after_today=False):
        
        today = date.today()
        this_year_start = today.replace(month=1, day=1)
        next_year_start = date(today.year + 1, 1, 1)

        if before_today and after_today:
            return self.date_between_dates(this_year_start, next_year_start)
        elif not before_today and after_today:
            return self.date_between_dates(today, next_year_start)
        elif not after_today and before_today:
            return self.date_between_dates(this_year_start, today)
        else:
            return today
139429
def birthdate
      month_data_element = bio_document.at("td.label[text()*='Date of Birth']").
          next_element.first_element_child
      date_month = month_data_element.inner_text.strip rescue ""
      year = month_data_element.next_element.inner_text.strip rescue ""
      Date.parse("#{date_month} #{year}") rescue nil
    end
990190
def is_birthday(self, dt=None):
        
        if dt is None:
            dt = Date.today()

        instance = dt1 = self.__class__(dt.year, dt.month, dt.day)

        return (self.month, self.day) == (instance.month, instance.day)
20884
def randomdate(year: int) -> datetime.date:
    
    if calendar.isleap(year):
        doy = random.randrange(366)
    else:
        doy = random.randrange(365)

    return datetime.date(year, 1, 1) + datetime.timedelta(days=doy)