<commit_before>from SGS_bot import *
import sys
import time

class MyBot(SGS_bot):
    """
        books the first shift availible
        if a shift is already booked, try to book an earlier shift"
    """
    def run(self):
        self.hack_login()
        week_offset = 0
        while True:
            booked_time = (-1,-1)
            d = self.get_calendar(0)
            terminate = False 
            while True:
                if terminate:
                    break
                for weekday in range(0,6):
                    if terminate:
                        break
                    for shift in range (0,8):
                        if (weekday, shift) in d['booked']:
                           booked_time = (weekday, shift)
                           print "already has the earliest shift booked\n"
                           terminate = True
                           break
                        if self.is_free_shift(week_offset, weekday,shift,d):
                            bs = self.get_booked_shift()
                            if bs != None:
                               self.try_to_unbook(bs['date'],bs['interval'])
                            if self.try_to_book(date, shift):
                                print "successfully booked shift " + str(shift) + " at " + date + "\n" 
                            else:
                                print "unable to book shift " + str(shift) + " at " + date + "\n" 
                            terminate = True
                            break
                week_offset = week_offset + 1
            d = self.get_calendar(week_offset-1)
            self.print_calendar(d)
            time.sleep(3600)
    def object_number(self):
        return 503004325
    def user_number(self):<commit_msg>minor change<commit_after>from SGS_bot import *
import sys
import time

class MyBot(SGS_bot):
    """
        books the first shift availible
        if a shift is already booked, try to book an earlier shift"
    """
    def run(self):
        self.hack_login()
        week_offset = 0
        while True:
            booked_time = (-1,-1)
            terminate = False 
            while True:
                d = self.get_calendar(week_offset)
                if terminate:
                    break
                for weekday in range(0,6):
                    if terminate:
                        break
                    for shift in range (0,8):
                        if (weekday, shift) in d['booked']:
                           booked_time = (weekday, shift)
                           print "already has the earliest shift booked\n"
                           terminate = True
                           break
                        if self.is_free_shift(week_offset, weekday,shift,d):
                            date = self.get_date_from_wd(week_offset,weekday) 
                            bs = self.get_booked_shift()
                            if bs != None:
                               self.try_to_unbook(bs['date'],bs['interval'])
                            if self.try_to_book(date, shift):
                                print "successfully booked shift " + str(shift) + " at " + date + "\n" 
                            else:
                                print "unable to book shift " + str(shift) + " at " + date + "\n" 
                            terminate = True
                            break
                week_offset = week_offset + 1
            d = self.get_calendar(week_offset-1)
            self.print_calendar(d)
            time.sleep(3600)
    def object_number(self):
        return 503004325
    def user_number(self):
{'fraction_non_alphanumeric': 0.0773224043715847, 'fraction_numerical': 0.012295081967213115, 'mean_word_length': 1.0578976953344577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6974409', 'n_tokens_mistral': 969, 'n_tokens_neox': 899, 'n_words': 242}