<commit_before># -*- coding: utf-8 -*-
from datetime import datetime as dt
from datetime import date as d

"""
python work_time.py
What time is working end time of {__day of the week__}?
Plerase your today's working-end hour >>>

Is accepted as a positive number only input value
"""
class WorkTime(object):
    DAY_OF_THE_WEEK = {
            0: "monday",
            1: "tuesday",
            2: "wednesday",
            3: "thursday",
            4: "friday",
            5: "saturday",
            6: "sunday"
            }
    ONE_HOUR = 60

    ERR_MSG = lambda x: '[{0}]\nPlease enter again!'.format(x)

    def set_value(self,weekday):
        for k,v in self.DAY_OF_THE_WEEK.items():
            if k == weekday:
                try:
                    ending_time = float(input(
                                'What time is working end time of \'{0}\'? > '.format(v)))
                    if ending_time > 0 and ending_time > dt.now().hour:
                        return ending_time
                    raise ValueError('0 > input value and now-time')
                except ValueError as e:
                    print('[{0}]\n'.format(e), 'Please enter again!')
                    return self.set_value(weekday)

    def get_time(self,hour):
        break_time = ''
        try:
            break_time = input('Do you have a break?(y/n)')
            if break_time != 'y' and break_time != 'n':
                raise ValueError('only use \'y\' or \'n\'')
            break_time = 1 if break_time == 'y' else 0
        except ValueError as e:
            print('[{0}]\n'.format(e), 'Please enter again!')
            return self.get_time(hour)

        rest = (lambda x: round(
            float(
                ((hour - x.hour) * self.ONE_HOUR - x.minute) / self.ONE_HOUR - break_time)
            , 3))(dt.now())
        print('resttime :{0}h'.format(rest))

    def __init__(self):
        self.get_time(self.set_value(d.today().weekday()))

if __name__ == '__main__':
    WorkTime()<commit_msg>Update work_time.py<commit_after># -*- coding: utf-8 -*-
from datetime import datetime as dt
from datetime import date as d

"""
python work_time.py
What time is working end time of {__day of the week__}?
Plerase your today's working-end hour >>>

Is accepted as a positive number only input value
"""
class WorkTime(object):
    DAY_OF_THE_WEEK = {
            0: "monday",
            1: "tuesday",
            2: "wednesday",
            3: "thursday",
            4: "friday",
            5: "saturday",
            6: "sunday"
            }
    ONE_HOUR = 60

    def set_value(self,weekday):
        for k,v in self.DAY_OF_THE_WEEK.items():
            if k == weekday:
                try:
                    ending_time = float(input(
                                'What time is working end time of \'{0}\'? > '.format(v)))
                    if ending_time > 0 and ending_time > dt.now().hour:
                        return ending_time
                    raise ValueError('0 > input value and now-time')
                except ValueError as e:
                    self.__print_error(e)
                    return self.set_value(weekday)

    def get_time(self,hour):
        break_time = ''
        try:
            break_time = input('Do you have a break?(y/n)')
            if break_time != 'y' and break_time != 'n':
                raise ValueError('only use \'y\' or \'n\'')
            break_time = 1 if break_time == 'y' else 0
        except ValueError as e:
            self.__print_error(e)
            return self.get_time(hour)

        rest = (lambda x: round(
            float(
                ((hour - x.hour) * self.ONE_HOUR - x.minute) / self.ONE_HOUR - break_time)
            , 3))(dt.now())
        print('resttime :{0}h'.format(rest))

    def __print_error(self,e):
        print((lambda x: '[{0}]\nPlease enter again!'.format(x))(e))

    def __init__(self):
        self.get_time(self.set_value(d.today().weekday()))

if __name__ == '__main__':
    WorkTime()
{'fraction_non_alphanumeric': 0.12615307903266018, 'fraction_numerical': 0.009473946646721515, 'mean_word_length': 1.676450967311541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3778002', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1194, 'n_words': 339}