def build_context(context):
	"""get_context method of doc or module is supposed to render content templates and push it into context"""
	context = frappe._dict(context)
	if not "url_prefix" in context:
		context.url_prefix = ""
	context.update(get_website_settings())
	context.update(frappe.local.conf.get("website_context") or {})

	# provide doc
	if context.doc:
		context.update(context.doc.as_dict())
		context.update(context.doc.website)
		if hasattr(context.doc, "get_context"):
			ret = context.doc.get_context(context)

			if ret:
				context.update(ret)

		for prop in ("no_cache", "no_sitemap"):
			if not context in prop:
				context[prop] = getattr(context.doc, prop, False)

	elif context.controller:
		module = frappe.get_module(context.controller)

		if module:
			# get config fields
			for prop in ("base_template_path", "template", "no_cache", "no_sitemap",
				"condition_field"):
				if hasattr(module, prop):
					context[prop] = getattr(module, prop)

			if hasattr(module, "get_context"):
				ret = module.get_context(context)
				if ret:
					context.update(ret)

			if hasattr(module, "get_children"):
				context.children = module.get_children(context)

	if context.show_sidebar:
		add_sidebar_data(context)

	add_metatags(context)

	# determine templates to be used
	if not context.base_template_path:
		app_base = frappe.get_hooks("base_template")
		context.base_template_path = app_base[0] if app_base else "templates/base.html"

	return context
dataset/ETHPy150Open frappe/frappe/frappe/website/context.py/build_context/swapped operands of `in`