<commit_before>import frappe

class MetaTags():
	def __init__(self, path, context):
		self.path = path
		self.context = context
		self.tags = frappe._dict(self.context.get("metatags") or {})
		self.init_metatags_from_context()
		self.set_opengraph_tags()
		self.set_twitter_tags()
		self.set_meta_published_on()
		self.set_metatags_from_website_route_meta()

	def init_metatags_from_context(self):
		for key in ('title', 'description', 'image', 'author', 'url', 'published_on'):
			if key not in self.tags and self.context.get(key):
				self.tags[key] = self.context[key]

		if not self.tags.get('title'):
			self.tags['title'] = self.context.get('name')

		if self.tags.get('image'):
			self.tags['image'] = frappe.utils.get_url(self.tags['image'])

		self.tags["language"] = frappe.local.lang or "en"

	def set_opengraph_tags(self):
		if "og:type" not in self.tags:
			self.tags["og:type"] = "article"

		for key in ('title', 'description', 'image', 'author', 'url'):
			if self.tags.get(key):
				self.tags['og:' + key] = self.tags.get(key)

	def set_twitter_tags(self):
		for key in ('title', 'description', 'image', 'author', 'url'):
			if self.tags.get(key):
				self.tags['twitter:' + key] = self.tags.get(key)

		if self.tags.get('image'):
			self.tags['twitter:card'] = "summary_large_image"<commit_msg>fix(minor): remove url from metatags<commit_after>import frappe

METATAGS = ('title', 'description', 'image', 'author', 'published_on')

class MetaTags():
	def __init__(self, path, context):
		self.path = path
		self.context = context
		self.tags = frappe._dict(self.context.get("metatags") or {})
		self.init_metatags_from_context()
		self.set_opengraph_tags()
		self.set_twitter_tags()
		self.set_meta_published_on()
		self.set_metatags_from_website_route_meta()

	def init_metatags_from_context(self):
		for key in METATAGS:
			if key not in self.tags and self.context.get(key):
				self.tags[key] = self.context[key]

		if not self.tags.get('title'):
			self.tags['title'] = self.context.get('name')

		if self.tags.get('image'):
			self.tags['image'] = frappe.utils.get_url(self.tags['image'])

		self.tags["language"] = frappe.local.lang or "en"

	def set_opengraph_tags(self):
		if "og:type" not in self.tags:
			self.tags["og:type"] = "article"

		for key in METATAGS:
			if self.tags.get(key):
				self.tags['og:' + key] = self.tags.get(key)

	def set_twitter_tags(self):
		for key in METATAGS:
			if self.tags.get(key):
				self.tags['twitter:' + key] = self.tags.get(key)

		if self.tags.get('image'):
			self.tags['twitter:card'] = "summary_large_image"
{'fraction_non_alphanumeric': 0.16957702755141638, 'fraction_numerical': 0.0, 'mean_word_length': 4.604347826086957, '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': '7382404', 'n_tokens_mistral': 1038, 'n_tokens_neox': 950, 'n_words': 184}