<commit_before>from plugins.categories import IRegularCommand

import pytz
from datetime import datetime, timedelta
import random

zones = pytz.all_timezones[:]

class BlazeIt (IRegularCommand):
	
	def command_blazeit(this, context, user, channel, args):
		return this.blazeit(4, 20, both=True)
	
	def command_thirteen(this, context, user, channel, args):
		return this.blazeit(13, 13, 13, both=False)
	
	def blazeit(this, h, m, s=0, both=False):
		random.shuffle(zones)
		realnow = datetime.now(pytz.timezone('Etc/UTC'))
		bestid = None
		bestthen = None
		min = timedelta.max
		for tzid in zones:
			tz = pytz.timezone(tzid)
			now = datetime.now(tz)
			then = tz.localize(datetime(
				now.year,
				now.month,
				now.day,
				h, m, s
			))
			afternoon = (h >= 11)
			while not then > now:
				whole_day = timedelta(1)
				if both or afternoon:
					then = tz.localize(datetime(
						then.year,
						then.month,
						then.day,
						h, m, s
					)) + whole_day
					afternoon = (h >= 11)
				else:
					then = tz.localize(datetime(
						then.year,
						then.month,
						then.day,<commit_msg>Allow users to get lucky and hit "0:00 away"<commit_after>from plugins.categories import IRegularCommand

import pytz
from datetime import datetime, timedelta
import random

zones = pytz.all_timezones[:]

class BlazeIt (IRegularCommand):
	
	def command_blazeit(this, context, user, channel, args):
		return this.blazeit(4, 20, both=True)
	
	def command_thirteen(this, context, user, channel, args):
		return this.blazeit(13, 13, 13, both=False)
	
	def blazeit(this, h, m, s=0, both=False):
		random.shuffle(zones)
		realnow = datetime.now(pytz.timezone('Etc/UTC'))
		bestid = None
		bestthen = None
		min = timedelta.max
		for tzid in zones:
			tz = pytz.timezone(tzid)
			now = datetime.now(tz)
			then = tz.localize(datetime(
				now.year,
				now.month,
				now.day,
				h, m, s
			))
			afternoon = (h >= 11)
			while now > then:
				whole_day = timedelta(1)
				if both or afternoon:
					then = tz.localize(datetime(
						then.year,
						then.month,
						then.day,
						h, m, s
					)) + whole_day
					afternoon = (h >= 11)
				else:
					then = tz.localize(datetime(
						then.year,
						then.month,
						then.day,
{'fraction_non_alphanumeric': 0.11878081577767817, 'fraction_numerical': 0.014791573285522188, 'mean_word_length': 2.9574468085106385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6299672', 'n_tokens_mistral': 1045, 'n_tokens_neox': 811, 'n_words': 208}