<commit_before>from datetime import datetime as DateTime  # done to fit in with caps = class
import datetime

import util
from product import Product


class Task:
	"""!
	Class that represents a single scheduled task
	"""

	def __init__(self, product, vessels, startTime=None):
		assert isinstance(product, Product), type(product)
		self.product = product
		self.vessels = []

		if startTime is None:
			startTime = datetime.datetime.now()
			assert isinstance(startTime, DateTime)
			startTime = startTime.replace(second=0, microsecond=0)

		if isinstance(startTime, DateTime):
			self.startTime = startTime
		elif isinstance(startTime, str):
			self.startTime = util.getDateTimeObject(startTime)
		else:
			raise TypeError("Task requires a datetime.datetime or str parameter not ", type(startTime))

		if isinstance(vessels, int):
			self.vessels.insert(0, vessels)
		elif isinstance(vessels, (list, tuple)):
			self.vessels = vessels
		elif vessels is None:  # TODO add None type handling
			pass
		else:
			raise TypeError("Task requires vessel or int parameter not ", type(vessels))

	def setDate(self, date):
		"""
		:param date: datetime date object or a string
		:return: None
		"""
		if isinstance(date, datetime.date):
			self.startTime = date
		elif isinstance(date, str):
			self.startTime = datetime.date(date)
		else:
			raise TypeError("setDate requires a datetime.datetime object or a string not", type(date))

	def getEndTime(self):
		"""
		Adds the duration to the time to get the finish time
		:return: datetime.time for when the task finishes
		"""
		util.addDateAndTime(self.startTime, self.duration)

	def printTask(self):
		print("  ", self.startTime, " ", self.product.brewTime, " ", self.product.amount, "kegs")
		print("   in vessels", str(self.vessels).strip("[]"))
<commit_msg>added get vessel<commit_after>from datetime import datetime as DateTime  # done to fit in with caps = class
import datetime

import util
from product import Product


class Task:
	"""!
	Class that represents a single scheduled task
	"""

	def __init__(self, product, vessels, startTime=None):
		assert isinstance(product, Product), type(product)
		self.product = product
		self.vessels = []

		if startTime is None:
			startTime = datetime.datetime.now()
			assert isinstance(startTime, DateTime)
			startTime = startTime.replace(second=0, microsecond=0)

		if isinstance(startTime, DateTime):
			self.startTime = startTime
		elif isinstance(startTime, str):
			self.startTime = util.getDateTimeObject(startTime)
		else:
			raise TypeError("Task requires a datetime.datetime or str parameter not ", type(startTime))

		if isinstance(vessels, int):
			self.vessels.insert(0, vessels)
		elif isinstance(vessels, (list, tuple)):
			self.vessels = vessels
		elif vessels is None:  # TODO add None type handling
			pass
		else:
			raise TypeError("Task requires vessel or int parameter not ", type(vessels))

	def setDate(self, date):
		"""
		:param date: datetime date object or a string
		:return: None
		"""
		if isinstance(date, datetime.date):
			self.startTime = date
		elif isinstance(date, str):
			self.startTime = datetime.date(date)
		else:
			raise TypeError("setDate requires a datetime.datetime object or a string not", type(date))

	def getEndTime(self):
		"""
		Adds the duration to the time to get the finish time
		:return: datetime.time for when the task finishes
		"""
		util.addDateAndTime(self.startTime, self.duration)

	def printTask(self):
		print("  ", self.startTime, " ", self.product.brewTime, " ", self.product.amount, "kegs")
		print("   in vessels", str(self.vessels).strip("[]"))

	def getVessel(self):
		return self.vessels
{'fraction_non_alphanumeric': 0.10828547990155865, 'fraction_numerical': 0.0016406890894175555, 'mean_word_length': 4.3091436865021775, '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': '6912367', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1086, 'n_words': 354}