<commit_before>from .hal import Resource
import iso8601

class Country(Resource):
	def __init__(self, data):
		super(Country, self).__init__(data)

		self.code = data["code"]
		self.name = data["name"]

class Language(Resource):
	def __init__(self, data):
		super(Language, self).__init__(data)
		self.code = data["code"]
		self.name = data["name"]

class Currency(Resource):
	def __init__(self, data):
		super(Currency, self).__init__(data)
		self.code = data["code"]
		self.name = data["name"]

class Venue(Resource):
	def __init__(self, data):
		super(Venue, self).__init__(data)
		self.id = data["id"]
		self.name = data["name"]

class MetroArea(Resource):
	def __init__(self, data):
		super(MetroArea, self).__init__(data)
		self.id = data["id"]
		self.name = data["name"]

class Event(Resource):
	def __init__(self, data):
		super(Event, self).__init__(data)
		self.id = data["id"]
		self.name = data["name"]
		self.start_date = iso8601.parse_date(data["start_date"]) if data["start_date"] is not None else None
		self.date_confirmed = data["date_confirmed"]
		self.end_date = iso8601.parse_date(data["end_date"]) if data["end_date"] is not None else None
		self.notes_html = data["notes_html"]
		self.restrictions_html = data["restrictions_html"]
		self.min_ticket_price = MoneyFactory.create(data["min_ticket_price"])

class Category(Resource):
	def __init__(self, data):
		super(Category, self).__init__(data)
		self.id = data["id"]
		self.name = data["name"]
		self.description_html = data["description_html"]
		self.min_ticket_price = MoneyFactory.create(data["min_ticket_price"])
		self.min_event_date = iso8601.parse_date(data["min_event_date"]) if data["min_event_date"] is not None else None
		self.max_event_date = iso8601.parse_date(data["max_event_date"]) if data["max_event_date"] is not None else None

class Search(Resource):
	def __init__(self, data):
		super(Search, self).__init__(data)
		self.title = data["title"]
		self.type = data["type"]
		self.type_description = data["type_description"]
		self.category = data.get("category")
		self.event = data.get("event")
		self.venue = data.get("venue")

class Listing(Resource):
	def __init__(self, data):
		super(Listing, self).__init__(data)
		self.id = data["id"]
		self.pickup_available = data["pickup_available"]
		self.download_available = data["download_available"]
		self.number_of_tickets = data["number_of_tickets"]
		self.seating = data["seating"]
		self.ticket_price = data["ticket_price"]
		self.estimated_ticket_price = MoneyFactory.create(data["estimated_ticket_price"])
		self.estimated_total_ticket_price = MoneyFactory.create(data["estimated_total_ticket_price"])
		self.estimated_booking_fee = MoneyFactory.create(data["estimated_booking_fee"])
		self.estimated_shipping = MoneyFactory.create(data["estimated_shipping"])
		self.estimated_vat = MoneyFactory.create(data["estimated_vat"])
		self.estimated_total_charge = MoneyFactory.create(data["estimated_total_charge"])

class Money(object):
	def __init__(self, data):
		self.amount = data["amount"]
		self.currency_code = data["currency_code"]
		self.display = data["display"]

class Seating(object):
	def __init__(self, data):
		self.seat_to = data["seat_to"]
		self.seat_from = data["seat_from"]
		self.row = data["row"]
		self.section = data["section"]


class MoneyFactory:
	@staticmethod
	def create(data):
		if data is not None:
			return Money(data)
		return None<commit_msg>- Update resources to handle field filtering<commit_after>from .hal import Resource
import iso8601

class Country(Resource):
	def __init__(self, data):
		super(Country, self).__init__(data)

		self.code = data.get("code", None)
		self.name = data.get("name", None)

class Language(Resource):
	def __init__(self, data):
		super(Language, self).__init__(data)
		self.code = data.get("code", None)
		self.name = data.get("name", None)

class Currency(Resource):
	def __init__(self, data):
		super(Currency, self).__init__(data)
		self.code = data.get("code", None)
		self.name = data.get("name", None)

class Venue(Resource):
	def __init__(self, data):
		super(Venue, self).__init__(data)
		self.id = data.get("id", None)
		self.name = data.get("name", None)

class MetroArea(Resource):
	def __init__(self, data):
		super(MetroArea, self).__init__(data)
		self.id = data.get("id", None)
		self.name = data.get("name", None)

class Event(Resource):
	def __init__(self, data):
		super(Event, self).__init__(data)
		self.id = data.get("id", None)
		self.name = data.get("name", None)
		self.start_date = iso8601.parse_date(data["start_date"]) if data.get("start_date", None) is not None else None
		self.date_confirmed = data.get("date_confirmed", None)
		self.end_date = iso8601.parse_date(data["end_date"]) if data.get("end_date", None) is not None else None
		self.notes_html = data.get("notes_html", None)
		self.restrictions_html = data.get("restrictions_html", None)
		self.min_ticket_price = MoneyFactory.create(data.get("min_ticket_price", None))

class Category(Resource):
	def __init__(self, data):
		super(Category, self).__init__(data)
		self.id = data.get("id", None)
		self.name = data.get("name", None)
		self.description_html = data.get("description_html", None)
		self.min_ticket_price = MoneyFactory.create(data.get("min_ticket_price", None))
		self.min_event_date = iso8601.parse_date(data["min_event_date"]) if data.get("min_event_date", None) is not None else None
		self.max_event_date = iso8601.parse_date(data["max_event_date"]) if data.get("max_event_date", None) is not None else None

class Search(Resource):
	def __init__(self, data):
		super(Search, self).__init__(data)
		self.title = data.get("title", None)
		self.type = data.get("type", None)
		self.type_description = data.get("type_description", None)
		self.category = data.get("category", None)
		self.event = data.get("event", None)
		self.venue = data.get("venue", None)

class Listing(Resource):
	def __init__(self, data):
		super(Listing, self).__init__(data)
		self.id = data.get("id", None)
		self.pickup_available = data.get("pickup_available", None)
		self.download_available = data.get("download_available", None)
		self.number_of_tickets = data.get("number_of_tickets", None)
		self.seating = data.get("seating", None)
		self.ticket_price = data.get("ticket_price", None)
		self.estimated_ticket_price = MoneyFactory.create(data.get("estimated_ticket_price", None))
		self.estimated_total_ticket_price = MoneyFactory.create(data.get("estimated_total_ticket_price", None))
		self.estimated_booking_fee = MoneyFactory.create(data.get("estimated_booking_fee", None))
		self.estimated_shipping = MoneyFactory.create(data.get("estimated_shipping", None))
		self.estimated_vat = MoneyFactory.create(data.get("estimated_vat", None))
		self.estimated_total_charge = MoneyFactory.create(data.get("estimated_total_charge", None))

class Money(object):
	def __init__(self, data):
		self.amount = data.get("amount", None)
		self.currency_code = data.get("currency_code", None)
		self.display = data.get("display", None)

class Seating(object):
	def __init__(self, data):
		self.seat_to = data.get("seat_to", None)
		self.seat_from = data.get("seat_from", None)
		self.row = data.get("row", None)
		self.section = data.get("section", None)


class MoneyFactory:
	@staticmethod
	def create(data):
		if data is not None:
			return Money(data)
		return None
{'fraction_non_alphanumeric': 0.14683888511216858, 'fraction_numerical': 0.005438477226376614, 'mean_word_length': 5.779723502304147, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6846224', 'n_tokens_mistral': 2692, 'n_tokens_neox': 2497, 'n_words': 492}