Parses relative to Easter Sunday holidays.
342209
public void parse (final int nYear, final HolidayMap aHolidayMap, final Holidays aConfig)
  {
    for (final RelativeToEasterSunday aDay : aConfig.getRelativeToEasterSunday ())
    {
      if (!isValid (aDay, nYear))
        continue;
      final ChronoLocalDate aEasterSunday = getEasterSunday (nYear, aDay.getChronology ());
      aEasterSunday.plus (aDay.getDays (), ChronoUnit.DAYS);
      final String sPropertiesKey = "christian." + aDay.getDescriptionPropertiesKey ();
      addChrstianHoliday (aEasterSunday,
                          sPropertiesKey,
                          XMLHolidayHelper.getType (aDay.getLocalizedType ()),
                          aHolidayMap);
    }
  }
1189826
private List<Observance> calculateSortedObservances() {
		List<DaylightSavingsTime> daylights = component.getDaylightSavingsTime();
		List<StandardTime> standards = component.getStandardTimes();

		int numObservances = standards.size() + daylights.size();
		List<Observance> sortedObservances = new ArrayList<Observance>(numObservances);

		sortedObservances.addAll(standards);
		sortedObservances.addAll(daylights);

		Collections.sort(sortedObservances, new Comparator<Observance>() {
			public int compare(Observance left, Observance right) {
				ICalDate startLeft = getValue(left.getDateStart());
				ICalDate startRight = getValue(right.getDateStart());
				if (startLeft == null && startRight == null) {
					return 0;
				}
				if (startLeft == null) {
					return -1;
				}
				if (startRight == null) {
					return 1;
				}

				return startLeft.getRawComponents().compareTo(startRight.getRawComponents());
			}
		});

		return Collections.unmodifiableList(sortedObservances);
	}
1254681
def _parse_weekday(val):
        '''  '''
        val = val.title()
        try:
            return list(calendar.day_abbr).index(val)
        except ValueError:
            try:
                return list(calendar.day_name).index(val)
            except ValueError:
                return None
978621
private void parseCT_RElt(XMLEventReader xmlEventReader, StringBuilder buf) throws XMLStreamException {
    // Precondition: pointing to <r>;  Post condition: pointing to </r>
    XMLEvent xmlEvent;
    while((xmlEvent = xmlEventReader.nextTag()).isStartElement()) {
      switch(xmlEvent.asStartElement().getName().getLocalPart()) {
        case "t": // Text
          buf.append(xmlEventReader.getElementText());
          break;
        case "rPr": // Run Properties
          skipElement(xmlEventReader);
          break;
        default:
          throw new IllegalArgumentException(xmlEvent.asStartElement().getName().getLocalPart());
      }
    }
  }
879781
private void parseCalendar(final StreamTokenizer tokeniser, Reader in,
            final ContentHandler handler) throws IOException, ParseException,
            URISyntaxException, ParserException {

        assertToken(tokeniser, in, ':');

        assertToken(tokeniser, in, Calendar.VCALENDAR, true, false);

        assertToken(tokeniser, in, StreamTokenizer.TT_EOL);

        handler.startCalendar();

        // parse calendar properties..
        propertyListParser.parse(tokeniser, in, handler);

        // parse components..
        componentListParser.parse(tokeniser, in, handler);

        // END:VCALENDAR
        // assertToken(tokeniser,Calendar.END);

        assertToken(tokeniser, in, ':');

        assertToken(tokeniser, in, Calendar.VCALENDAR, true, false);

        handler.endCalendar();
    }
310076
function d3_time_parseWeekday(date, string, i) {
  d3_time_weekdayRe.lastIndex = 0;
  var n = d3_time_weekdayRe.exec(string.substring(i, i + 10));
  return n ? i += n[0].length : -1;
}
376709
private static Set<Date> getHolidaySet(int year) {
		if (holidays == null) {
			holidays = new HashMap<Integer, Set<Date>>();
		}
		if (!holidays.containsKey(year)) {
			Set<Date> yearSet = new HashSet<Date>();

			// Add set holidays.
			yearSet.add(getDate(1, Calendar.JANUARY, year));
			yearSet.add(getDate(1, Calendar.MAY, year));
			yearSet.add(getDate(17, Calendar.MAY, year));
			yearSet.add(getDate(25, Calendar.DECEMBER, year));
			yearSet.add(getDate(26, Calendar.DECEMBER, year));

			// Add movable holidays - based on easter day.
			Calendar easterDay = dateToCalendar(getEasterDay(year));

			// Sunday before easter.
			yearSet.add(rollGetDate(easterDay, -7));

			// Thurday before easter.
			yearSet.add(rollGetDate(easterDay, -3));

			// Friday before easter.
			yearSet.add(rollGetDate(easterDay, -2));

			// Easter day.
			yearSet.add(easterDay.getTime());

			// Second easter day.
			yearSet.add(rollGetDate(easterDay, 1));

			// "Kristi himmelfart" day.
			yearSet.add(rollGetDate(easterDay, 39));

			// "Pinse" day.
			yearSet.add(rollGetDate(easterDay, 49));

			// Second "Pinse" day.
			yearSet.add(rollGetDate(easterDay, 50));

			holidays.put(year, yearSet);
		}
		return holidays.get(year);
	}
275878
def parseUri(stream, uri=None):
    """"""
    return etree.parse(stream, parser=_get_xmlparser(), base_url=uri)
1071930
private I_CmsListDateRestriction parseFromToday(CmsXmlContentValueLocation dateRestriction) {

        CmsXmlContentValueLocation location = dateRestriction.getSubValue(N_FROM_TODAY);
        if (location == null) {
            return null;
        }
        CmsXmlContentValueLocation countLoc = location.getSubValue(N_COUNT);
        CmsXmlContentValueLocation unitLoc = location.getSubValue(N_UNIT);
        CmsXmlContentValueLocation directionLoc = location.getSubValue(N_DIRECTION);

        TimeDirection direction = parseDirection(directionLoc);
        Integer count = parsePositiveNumber(countLoc);
        TimeUnit unit = parseUnit(unitLoc);
        if (count == null) {
            return null;
        }
        return new CmsListDateFromTodayRestriction(count.intValue(), unit, direction);
    }
426687
def parsedate(data):
    """"""
    t = parsedate_tz(data)
    if isinstance(t, tuple):
        return t[:9]
    else:
        return t
1090382
public function setHolidays(\DateTime $lngDate, $inclCatholicEaster = false, $inclWorkingHolidays = false)
    {
        $givenYear = $lngDate->format('Y');
        $daying    = array_merge($this->setHolidaysOrthodoxEaster($lngDate), $this->setHolidaysFixed($lngDate));
        if ($inclWorkingHolidays) {
            $daying = array_merge($daying, $this->setHolidaysFixedButWorking($lngDate));
        }
        if ($inclCatholicEaster) { // Catholic easter is already known by PHP
            $firstEasterDate  = strtotime($this->getEasterDatetime($givenYear)->format('Y-m-d'));
            $secondEasterDate = strtotime('+1 day', $firstEasterDate);
            $daying           = array_merge($daying, [
                $firstEasterDate,
                $secondEasterDate,
            ]);
        }
        sort($daying);
        return array_unique($daying); // remove duplicate for when catholic and orthodox easter match
    }
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
795770
private Map<String, Integer> parseFirstDays(JsonObject root) {
    JsonObject node = resolve(root, "supplemental", "weekData", "firstDay");
    Map<String, Integer> m = new HashMap<>();
    for (String key : objectKeys(node)) {
      String value = string(node, key);
      m.put(key, NUMERIC_DAYS.get(value));
    }
    return m;
  }
1188261
def _fuzzy_time_parse(self, value):
        

        value = value.lower().strip()
        today = datetime.date.today()

        if value in ('today', 't'):
            return today

        else:
            kwargs = {}

            if value in ('y', 'yesterday'):
                kwargs['days'] = -1

            elif value in ('w', 'wk', 'week', 'last week'):
                kwargs['days'] = -7

            else:
                # match days
                match = re.match(r'(\d+)\s*(d|day|days)\s*(ago)?$', value)
                if match:
                    kwargs['days'] = -int(match.groups(1)[0])

                else:
                    # match weeks
                    match = re.match(r'(\d+)\s*(w|wk|week|weeks)\s*(ago)?$',
                                     value)
                    if match:
                        kwargs['weeks'] = -int(match.groups(1)[0])

            if kwargs:
                return today + datetime.timedelta(**kwargs)

            return None
1330435
def holidays_set(self, year=None):
        ""
        return set([day for day, label in self.holidays(year)])
91827
def _parse_dates(self, prop=DATES):
        

        return parse_dates(self._xml_tree, self._data_structures[prop])
927362
def Parse(self):
    """"""
    for data in self.Query(self.EVENTS_QUERY):
      (timestamp, agent_bundle_identifier, agent_name, url, sender,
       sender_address, type_number, title, referrer, referrer_alias) = data
      yield [
          timestamp, "OSX_QUARANTINE", url, referrer, title, agent_name,
          agent_bundle_identifier, sender, sender_address, type_number,
          referrer_alias
      ]