parameters: (year, month, dayofweek, hour, minute, whichweek)
docstring: dayofweek == 0 means Sunday, whichweek 5 means last instance
docstring_summary: dayofweek == 0 means Sunday, whichweek 5 means last instance
docstring_tokens: dayofweek == 0 means Sunday whichweek 5 means last instance
function: def picknthweekday(year, month, dayofweek, hour, minute, whichweek):
      """dayofweek == 0 means Sunday, whichweek 5 means last instance"""
      first = datetime.datetime(year, month, 1, hour, minute)
      weekdayone = first.replace(day=((dayofweek-first.isoweekday())%7+1))
      for n in xrange(whichweek):
          dt = weekdayone+(whichweek-n)*ONEWEEK
          if dt.month == month:
              return dt
function_tokens: def picknthweekday ( year , month , dayofweek , hour , minute , whichweek ) : first = datetime . datetime ( year , month , 1 , hour , minute ) weekdayone = first . replace ( day = ( ( dayofweek - first . isoweekday ( ) ) % 7 + 1 ) ) for n in xrange ( whichweek ) : dt = weekdayone + ( whichweek - n ) * ONEWEEK if dt . month == month : return dt