List all years for the select
@return {[type]} [description]
183317
function getYearsList() {
            var yearsList = [];
            for (var i = 2005; i <= moment().year(); i++) {
                yearsList.push(i);
            }
            return yearsList;
        }
1251480
public function getYears($limit = 90) {
        $years = array();
        $now_year = date('Y');
        for ($i = 0; $i < $limit; $i++) {
            $years[] = $now_year - $i;
        }
        return $years;
    }
1214258
def years_match(data, years):
    
    years = [years] if isinstance(years, int) else years
    dt = datetime.datetime
    if isinstance(years, dt) or isinstance(years[0], dt):
        error_msg = "`year` can only be filtered with ints or lists of ints"
        raise TypeError(error_msg)
    return data.isin(years)
606405
function() {
		var dates = [];
		for (var i = 0; i < this.events.length; i++) {
			if (this.events[i].end_date) {
				dates.push({ date: this.events[i].end_date });
			} else {
				dates.push({ date: this.events[i].start_date });
			}
		}
		for (var i = 0; i < this.eras.length; i++) {
			if (this.eras[i].end_date) {
				dates.push({ date: this.eras[i].end_date });
			} else {
				dates.push({ date: this.eras[i].start_date });
			}
		}
		TL.DateUtil.sortByDate(dates, 'date');
		return dates.slice(-1)[0].date;
	}
735431
def years_after(year = 0)
      Age.new(birthday: birthday, present_day: present_day.next_year(year))
    end
650073
def annual_event_counts(kind='all'):
    
    qs = Event.objects

    if kind != 'all':
        qs = qs.filter(kind=kind)

    qs = qs.annotate(year=TruncYear('date')) \
            .values('year') \
            .annotate(total=Count('id')) \
            .order_by('year')

    return qs
280190
function getDaysByYear({
  minDate, maxDate, year,
}) {
  const days = [];
  const maxYear = new Date(maxDate).getFullYear();
  const minYear = new Date(minDate).getFullYear();
  const arr = [];
  const start = year - 1 >= minYear ? year - 1 : minYear;
  for (let i = 0; i <= 2; i++) {
    if (i + start <= maxYear) {
      arr.push(start + i);
    }
  }
  arr.forEach((item) => {
    for (let i = 1; i < 13; i += 1) {
      getDaysByMonth({
        minDate, maxDate, year: item, month: i - 1,
      }).forEach((el) => {
        days.push(`${item}${addZero(i)}${addZero(el.value)}` - 0);
      });
    }
  });
  return days;
}
133238
def _check_stringify_year_column(self, column_index):
        '''
        
        '''
        table_column = TableTranspose(self.table)[column_index]
        # State trackers
        prior_year = None
        for row_index in range(self.start[0]+1, self.end[0]):
            current_year = table_column[row_index]
            if not self._check_years(current_year, prior_year):
                return
            # Only copy when we see a non-empty entry
            if current_year:
                prior_year = current_year

        # If we have a title of years, convert them to strings
        self._stringify_column(column_index)
802582
function all(parent) {
  var self = this
  var children = parent.children
  var length = children.length
  var results = []
  var index = -1

  while (++index < length) {
    results[index] = self.visit(children[index], parent)
  }

  return results
}
887415
def select(*fields)
      raise OData::NotSupportedError.new("You cannot call both the `links` method and the `select` method in the same query.") if @links_navigation_property
      raise OData::NotSupportedError.new("You cannot call both the `count` method and the `select` method in the same query.") if @count

      @select |= fields

      expands =  fields.find_all { |f| /\// =~ f }
      expands.each do |e|
        parts = e.split '/'
        @expands |= [parts[0...-1].join('/')]
      end

      self
    end
195150
function() {

            // return list
            var ret = [];

            // get current timestamp
            var timestamp = this.getTimestamp();

            // iterate over storage keys to find all counters
            var that = this;
            this._iterKeys(function(storageKey) {

                // if its not a timestamp key, skip it
                if (storageKey.indexOf(that._expiration_key_prefix) === 0) {

                    // get item key
                    var itemKey = storageKey.substr(that._expiration_key_prefix.length);

                    // if expired remove it + the item
                    if (that.isExpired(itemKey)) {

                        that.removeItem(itemKey);
                        ret.push(itemKey);
                    }
                }
            });

            // return list with removed keys
            return ret;
        }
1133196
def get_all_starts(year)
      results = []
      app = get_all_appearances(year)
      if app.start == true
        results << app
      end
    end
367055
function findYearElement(parent, year) {
    var node = parent[0] || parent;
    var years = node.querySelectorAll('[md-calendar-year-body]');
    var yearHeader = year.toString();
    var target;

    for (var i = 0; i < years.length; i++) {
      target = years[i];
      if (target.querySelector('.md-calendar-month-label').textContent === yearHeader) {
        return target;
      }
    }
    return null;
  }
701711
def select(self, versions):
        """"""
        options = list(self.filter(versions))
        if options:
            return max(options)
        return None
250771
public final void showYear(Year year) {
        requireNonNull(year);
        if (!yearPage.isHidden()) {
            selectedPage.set(getYearPage());
            setDate(year.atDay(1));
        }
    }
894292
def get(self, select):
        
        if is_list(select):
            return [(d[s] for s in select) for d in self.data]
        else:
            return [d[select] for d in self.data]
66216
function getMonthsByYear({ minDate, maxDate, year }) {
  const max = new Date(maxDate);
  const min = new Date(minDate);
  const maxYear = max.getFullYear();
  const minYear = min.getFullYear();
  let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((item, index) => ({
    text: index + 1,
    value: index,
  }));
  if (year > minYear && year < maxYear) {
    return arr;
  }
  const maxTime = max.getTime();
  const minTime = min.getTime();
  if (year === maxYear) {
    arr = arr.filter((item) => {
      const date = new Date(year, item.value, 1);
      return date.getTime() < maxTime;
    });
  }
  if (year === minYear) {
    arr = arr.filter((item) => {
      const date = new Date(year, item.value + 1, 0);
      return date.getTime() > minTime;
    });
  }
  return arr;
}