def METHOD_NAME(context, site=None):
	from frappe.utils.doctor import any_job_pending
	if not site:
		site = get_site(context)
	try:
		frappe.init(site=site)
		pending_jobs = any_job_pending(site=site)
		if pending_jobs:
			print(f"NOT READY for migration: site {site} has pending background jobs")
			sys.exit(1)
		else:
			print(f"READY for migration: site {site} does not have any background jobs")
			return 0
	finally:
		frappe.destroy()