def METHOD_NAME(doctype, name, todo=None, assign_to=None, status="Cancelled"):
	"""remove from todo"""
	try:
		if not todo:
			todo = frappe.db.get_value(
				"ToDo",
				{
					"reference_type": doctype,
					"reference_name": name,
					"allocated_to": assign_to,
					"status": ("!=", status),
				},
			)
		if todo:
			todo = frappe.get_doc("ToDo", todo)
			todo.status = status
			todo.save(ignore_permissions=True)
			notify_assignment(todo.assigned_by, todo.allocated_to, todo.reference_type, todo.reference_name)
	except frappe.DoesNotExistError:
		pass
	# clear assigned_to if field exists
	if frappe.get_meta(doctype).get_field("assigned_to") and status in ("Cancelled", "Closed"):
		frappe.db.set_value(doctype, name, "assigned_to", None)
	return get({"doctype": doctype, "name": name})