def _calc_day(self, next_run, cron):
        # start with dow as per cron if dow and day are set
        # then dow is used if it comes before day. If dow
        # is *, then ignore it.
        if str(cron["dow"]) != str("*"):
            # convert any integers to lists in order to easily compare values
            m = next_run.month
            while True:
                if next_run.month is not m:
                    next_run = next_run.replace(hour=0, minute=0)
                    next_run = self._calc_month(next_run, cron)
                if next_run.weekday() in cron["dow"] or next_run.day in cron["day"]:
                    return next_run
                else:
                    one_day = datetime.timedelta(days=1)
                    next_run = next_run + one_day
        else:
            m = next_run.month
            while True:
                if next_run.month is not m:
                    next_run = next_run.replace(hour=0, minute=0)
                    next_run = self._calc_month(next_run, cron)
                # if cron["dow"] is next_run.weekday() or cron["day"] is next_run.day:
                if next_run.day in cron["day"]:
                    return next_run
                else:
                    one_day = datetime.timedelta(days=1)
                    next_run = next_run + one_day
dataset/ETHPy150Open kuri65536/python-for-android/python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/cron.py/Cron._calc_day/original