Return a dictionary of this collection's values grouped by each day of year.

        Key values are between 1-365.
16438
def group_by_day(self):
        
        hourly_data_by_day = OrderedDict()
        for d in xrange(1, 366):
            hourly_data_by_day[d] = []
        a_per = self.header.analysis_period
        indx_per_day = 24 * a_per.timestep
        start_doy = sum(a_per._num_of_days_each_month[:a_per.st_time.month-1]) \
            + a_per.st_time.day
        if not a_per.is_reversed:
            for i in range(0, len(self._values), indx_per_day):
                hourly_data_by_day[start_doy] = self._values[i:i + indx_per_day]
                start_doy += 1
        else:
            end_ind = 24 * a_per.timestep * (365 - start_doy)
            for i in range(0, end_ind + 1, indx_per_day):
                hourly_data_by_day[start_doy] = self._values[i:i + indx_per_day]
                start_doy += 1
            start_doy = 1
            for i in range(end_ind, len(self._values), indx_per_day):
                hourly_data_by_day[start_doy] = self._values[i:i + indx_per_day]
                start_doy += 1
        return hourly_data_by_day
1152041
def as_dict(df, ix=':'):
    
    if isinstance(df.index, pd.DatetimeIndex):
        df['datetime'] = df.index
    return df.to_dict(orient='records')[ix]
1309680
def __getDummyDateList():
    

    D = []
    for y in xrange(2001, 2010):
        for d in xrange(1, 365, 1):
            D.append('A%04d%03d' % (y, d))

    return D
193266
def filter_by_doys(self, doys):
        
        _filt_values = []
        _filt_datetimes = []
        for i, d in enumerate(self.datetimes):
            if d in doys:
                _filt_datetimes.append(d)
                _filt_values.append(self._values[i])
        _filt_header = self.header.duplicate()
        return DailyCollection(_filt_header, _filt_values, _filt_datetimes)
1195928
def iter_by_year(self):
        """"""
        for key, grp in self.rets.groupby(lambda x: x.year):
            yield key, CumulativeRets(rets=grp)
295383
def per_system_data(self):
        
        ret = {}
        for cache_date in self.cache_dates:
            data = self._cache_get(cache_date)
            ret[cache_date] = {
                self._column_value(x): data['by_system'][x]
                for x in data['by_system']
            }
            if len(ret[cache_date]) == 0:
                ret[cache_date]['unknown'] = 0
        return ret
1233611
def getyrdoy(date):
    """"""

    try:
        doy = date.toordinal()-datetime(date.year,1,1).toordinal()+1
    except AttributeError:
        raise AttributeError("Must supply a pandas datetime object or " +
                             "equivalent")
    else:
        return date.year, doy
588846
def get_fixed_holidays(self, year):
        
        days = []
        for month, day, label in self.FIXED_HOLIDAYS:
            days.append((date(year, month, day), label))
        return days
271414
def values(self):
        
        return dict((k, getattr(self, k)) for k in self._keys)
587886
public static Date[] getHolidays(int year) {
		Set<Date> days = getHolidaySet(year);
		Date[] dates = days.toArray(new Date[days.size()]);
		Arrays.sort(dates);
		return dates;
	}
1332688
function (year) {
			var daysCount = 0;
			for (var i = 1; i <= 12; i++) {
				daysCount += this.daysInMonth(year, i);
			}
			return daysCount;
		}
872671
def group_by(self, fields, items=None):
        
        result = defaultdict(list)
        if items is None:
            items = self.items()

        try:
            key = operator.attrgetter(fields + '')
        except TypeError:
            def key(obj, names=tuple(fields)):
                'Helper to return group key tuple'
                return tuple(getattr(obj, x) for x in names)

        for item in items:
            result[key(item)].append(item)

        return result
1030891
def get_year(self):
        
        year = super(BuildableDayArchiveView, self).get_year()
        fmt = self.get_year_format()
        dt = date(int(year), 1, 1)
        return dt.strftime(fmt)
632152
def aggregate(self, start, end):
        '''
        
        '''
        last = self.objects(
            level='daily', date__lte=self.iso(end),
            date__gte=self.iso(start)).order_by('-date').first()
        return last.values[self.name]
417781
def GetCalendarDatesFieldValuesTuples(self):
    """"""
    result = []
    for date_tuple in self.GenerateCalendarDatesFieldValuesTuples():
      result.append(date_tuple)
    result.sort()  # helps with __eq__
    return result
1004211
def to_dict(self):
    """"""
    return {
      "timestamp": int(self.timestamp),
      "timezone": self.timezone,
      "time_of_day": self.time_of_day,
      "day_of_week": self.day_of_week,
      "day_of_month": self.day_of_month,
      "month_of_year": self.month_of_year,
      "utc_iso": self.utc_iso
    }
240599
def get_year_week(timestamp):
    """"""
    time_ = datetime.fromtimestamp(timestamp)
    year = time_.isocalendar()[0]
    week = time_.isocalendar()[1]
    return year, week