def METHOD_NAME(self, key, value, timestamp):
    # week day in python is counted from sunday(0) and on mbed side week day is counted from monday(0).
    # year day in python is counted from 1 and on mbed side year day is counted from 0.
    week_day = ((self.date.timetuple().tm_wday + 1) % 7)
    year_day = self.date.timetuple().tm_yday - 1
    # Fix for RTC which not have full leap year support.
    if (not self.full_leap_year_support):
        if self.date >= self.edge_date:
            # After 28.02.2100 we should be one day off - add this day and store original
            date_org = self.date
            self.date += datetime.timedelta(days = 1)
            # Adjust week day.
            week_day = ((self.date.timetuple().tm_wday + 1) % 7)
            # Adjust year day.
            if (self.date.year == 2100):
                year_day = self.date.timetuple().tm_yday - 1
            else:
                year_day = date_org.timetuple().tm_yday - 1
            # Last day in year
            if (self.date.month == 1 and self.date.day == 1):
                if (self.date.year == 2101):
                    # Exception for year 2100 - ivalid handled by RTC without full leap year support
                    year_day = 365
                else:
                    year_day = date_org.timetuple().tm_yday - 1
    t = (self.date.year , self.date.month, self.date.day, self.date.hour, self.date.minute, self.date.second, 0, 0, 0)
    expected_timestamp = calendar.timegm(t)
    actual_timestamp = int(value) & 0xffffffff # convert to unsigned int
    # encode week day and year day in the response
    response = (week_day << 16) | year_day
    if (actual_timestamp == expected_timestamp):
        # response contains encoded week day and year day
        self.send_kv("passed", str(response))
    else:
        self.send_kv("failed", 0)
        print("expected = %d, result = %d" %  (expected_timestamp , actual_timestamp))
    # calculate next date
    if (self.first):
        days_range = calendar.monthrange(self.date.year, self.date.month)
        self.date = self.date.replace(day = days_range[1], minute = 59, second = 59)
        self.first = not self.first
    else:
        self.date += datetime.timedelta(days = 1)
        if (self.date.month == 1):
            self.year_id += 1
            if (len(self.years) == self.year_id):
                # All years were processed, no need to calc next date
                return
            self.date = self.date.replace(year = self.years[self.year_id])
        self.date = self.date.replace(day = 1, minute = 0, second = 0)
        self.first = not self.first