def get_parent_doc(self):
		if not hasattr(self, "parent_doc"):
			if self.reference_doctype and self.reference_name:
				self.parent_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
			else:
				self.parent_doc = None
		return self.parent_doc
Find and return switches controlled by shell commands.
dataset/ETHPy150Open frappe/frappe/frappe/core/doctype/communication/communication.py/Communication.get_parent_doc--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/command_line.py/setup_platform