def METHOD_NAME(company_abbr, parenttype=None, parent=None):
	if parenttype and parent:
		company = frappe.get_cached_value(parenttype, parent, "company")
	else:
		company = frappe.db.get_value("Company", filters={"abbr": company_abbr})
	if not company:
		companies = frappe.get_all("Company")
		if len(companies) == 1:
			company = companies[0].name
	return company