docstr: Calculates the datetime of the occurrence from the year
code: def year_to_epoch(self, year):
      """Calculates the datetime of the occurrence from the year"""
      # We know year and month, we need to convert w, d into day of month
      #
      # Week 1 is the first week in which day `d` (where 0 = Sunday) appears.
      # Week 5 represents the last occurrence of day `d`, so we need to know
      # the range of the month.
      first_day, days_in_month = calendar.monthrange(year, self.m)
  
      # This equation seems magical, so I'll break it down:
      # 1. calendar says 0 = Monday, POSIX says 0 = Sunday
      #    so we need first_day + 1 to get 1 = Monday -> 7 = Sunday,
      #    which is still equivalent because this math is mod 7
      # 2. Get first day - desired day mod 7: -1 % 7 = 6, so we don't need
      #    to do anything to adjust negative numbers.
      # 3. Add 1 because month days are a 1-based index.
      month_day = (self.d - (first_day + 1)) % 7 + 1
  
      # Now use a 0-based index version of `w` to calculate the w-th
      # occurrence of `d`
      month_day += (self.w - 1) * 7
  
      # month_day will only be > days_in_month if w was 5, and `w` means
      # "last occurrence of `d`", so now we just check if we over-shot the
      # end of the month and if so knock off 1 week.
      if month_day > days_in_month:
          month_day -= 7
  
      ordinal = self._ymd2ord(year, self.m, month_day)
      epoch = ordinal * 86400
      epoch += self.hour * 3600 + self.minute * 60 + self.second
      return epoch
  
imports: import bisect
  import calendar
  import collections
  import functools
  import re
  import weakref
  from datetime import datetime, timedelta, tzinfo
  from .None import _common, _tzpath
label_desc: Use image node_id 3 for calling the _CalendarOffset obj's underlying member method code with example usage: obj.year_to_epoch(year) and returns: epoch