Injuries by week
499028
def get_injuries(self, season, week):
        
        result = self._method_call("Injuries/{season}/{week}", "stats", season=season, week=week)
        return result
1065352
def this_week():
        
        since = TODAY + delta(weekday=MONDAY(-1))
        until = since + delta(weeks=1)
        return Date(since), Date(until)
326262
def search_weekday(weekday, jd, direction, offset):
    ''''''
    return weekday_before(weekday, jd + (direction * offset))
404141
def pretty_print_user_list(list)
      total = 0
      data = []
      # Header row
      data.push('Asset', 'Total Value', 'Change % (Week)')
      list.user_pairs.each do |user_pair|
        data.push(user_pair.symbol)
        data.push(user_pair.valuation.format)
        data.push(user_pair.perchant_change_week.to_s)
        total += user_pair.valuation
      end

      data.push('', '', '')
      data.push('TOTAL:', total.format, '')
      data.push('', '', '')
      print_arrays(data, 3)
    end
762695
def week(self):
        ''''''
        self.magnification = 345600
        self._update(self.baseNumber, self.magnification)
        return self
607992
def get_box_score_by_team(self, season, week, team_id):
        
        result = self._method_call("BoxScoreV3/{season}/{week}/{team_id}", "stats", season=season, week=week, team_id=team_id)
        return result
62303
def _weeks_check(self, data, week_type):
        """"""
        assert isinstance(data, dict), '{}' \
            ' must be an OrderedDict. Got {}.'.format(week_type, type(data))
        if bool(data) is True:
            for val in data.values():
                assert isinstance(val, AnalysisPeriod), '{} dictionary must contain' \
                    ' AnalysisPeriod objects. Got {}.'.format(week_type, type(val))
                assert len(val.doys_int) == 7, '{} AnalysisPeriod must be for'\
                    ' a week.  Got AnalysisPeriod for {} days.'.format(
                        week_type, type(val))
1137882
function(weekBeginDate) {
        var overlaps = false;
        var nextWeek = this.add(weekBeginDate, this.DAY, 6);
        if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {
            overlaps = true;
        }
        return overlaps;
    }
537625
private void addWeekdayLabels() {
        weekdayLabels = new ArrayList<JLabel>();
        int weekdayLabelRowY = constantFirstWeekdayLabelCell.y;
        int weekdayLabelWidthInCells = 1;
        int weekdayLabelHeightInCells = 3;
        for (int i = 0; i < 7; ++i) {
            int weekdayLabelColumnX = (i + constantFirstWeekdayLabelCell.x);
            JLabel weekdayLabel = new JLabel();
            weekdayLabel.setHorizontalAlignment(SwingConstants.CENTER);
            weekdayLabel.setVerticalAlignment(SwingConstants.CENTER);
            weekdayLabel.setBorder(new EmptyBorder(0, 2, 0, 2));
            weekdayLabel.setOpaque(true);
            weekdayLabel.setText("wd" + i);
            CellConstraints constraints = CC.xywh(weekdayLabelColumnX, weekdayLabelRowY,
                weekdayLabelWidthInCells, weekdayLabelHeightInCells);
            centerPanel.add(weekdayLabel, constraints);
            weekdayLabels.add(weekdayLabel);
        }
    }
1092474
def get_projected_player_game_stats_by_week(self, season, week):
        
        result = self._method_call("PlayerGameProjectionStatsByWeek/{season}/{week}", "projections", season=season, week=week)
        return result
228286
def get_projected_player_game_stats_by_player(self, season, week, player_id):
        
        result = self._method_call("PlayerGameProjectionStatsByPlayerID/{season}/{week}/{player_id}", "projections", season=season, week=week, player_id=player_id)
        return result
853807
def weekly_plots(
    df,
    variable,
    renormalize = True,
    plot        = True,
    scatter     = False,
    linestyle   = "-",
    linewidth   = 1,
    s           = 1
    ):
    
    if not "days_through_week" in df.columns:
        log.error("field days_through_week not found in DataFrame")
        return False
    weeks = []
    for group in df.groupby(df.index.week):
        weeks.append(group[1])
    scaler = MinMaxScaler()
    plt.ylabel(variable);
    for week in weeks:
        if renormalize:
            values = scaler.fit_transform(week[[variable]])
        else:
            values = week[variable]
        if plot:
            plt.plot(week["days_through_week"], values, linestyle = linestyle, linewidth = linewidth)
        if scatter:
            plt.scatter(week["days_through_week"], values, s = s)
    plt.xticks(
        [     0.5,       1.5,         2.5,        3.5,      4.5,        5.5,      6.5],
        ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    )
1014119
def get_weekly_charts(self, chart_kind, from_date=None, to_date=None):
        
        method = ".getWeekly" + chart_kind.title() + "Chart"
        chart_type = eval(chart_kind.title())  # string to type

        params = self._get_params()
        if from_date and to_date:
            params["from"] = from_date
            params["to"] = to_date

        doc = self._request(self.ws_prefix + method, True, params)

        seq = []
        for node in doc.getElementsByTagName(chart_kind.lower()):
            if chart_kind == "artist":
                item = chart_type(_extract(node, "name"), self.network)
            else:
                item = chart_type(
                    _extract(node, "artist"), _extract(node, "name"), self.network
                )
            weight = _number(_extract(node, "playcount"))
            seq.append(TopItem(item, weight))

        return seq
1315595
private void getWeeklyDates(Calendar calendar, int frequency, List<Date> dates)
   {
      int currentDay = calendar.get(Calendar.DAY_OF_WEEK);

      while (moreDates(calendar, dates))
      {
         int offset = 0;
         for (int dayIndex = 0; dayIndex < 7; dayIndex++)
         {
            if (getWeeklyDay(Day.getInstance(currentDay)))
            {
               if (offset != 0)
               {
                  calendar.add(Calendar.DAY_OF_YEAR, offset);
                  offset = 0;
               }
               if (!moreDates(calendar, dates))
               {
                  break;
               }
               dates.add(calendar.getTime());
            }

            ++offset;
            ++currentDay;

            if (currentDay > 7)
            {
               currentDay = 1;
            }
         }

         if (frequency > 1)
         {
            offset += (7 * (frequency - 1));
         }
         calendar.add(Calendar.DAY_OF_YEAR, offset);
      }
   }
652004
async function getWeekData() {
  const response = await fetch(weekDataUrl);
  const json = await response.json();
  return json.supplemental.weekData;
}
748508
private static int weekRange(int weekBasedYear) {
        LocalDate date = LocalDate.of(weekBasedYear, 1, 1);
        // 53 weeks if year starts on Thursday, or Wed in a leap year
        if (date.getDayOfWeek() == THURSDAY || (date.getDayOfWeek() == WEDNESDAY && date.isLeapYear())) {
            return 53;
        }
        return 52;
    }
35306
private static int getWeekIndex(final Calendar cal) {
        final int val = cal.get(Calendar.DAY_OF_WEEK);
        switch(val) {
            case Calendar.SUNDAY:
                return 0;
            case Calendar.MONDAY:
                return 1;
            case Calendar.TUESDAY:
                return 2;
            case Calendar.WEDNESDAY:
                return 3;
            case Calendar.THURSDAY:
                return 4;
            case Calendar.FRIDAY:
                return 5;
            case Calendar.SATURDAY:
                return 6;
        }

        return 0;
    }