<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apns_send_bulk_message( 	registration_ids, alert, application_id=None, certfile=None, **kwargs ):
 	""" 	Sends an APNS notification to one or more registration_ids. 	The registration_ids argument needs to be a list. 	Note that if set alert should always be a string. If it is not set, 	it won"t be included in the notification. You will need to pass None 	to this for silent notifications. 	"""


	results = _apns_send(
		registration_ids, alert, batch=True, application_id=application_id,
		certfile=certfile, **kwargs
	)
	inactive_tokens = [token for token, result in results.items() if result == "Unregistered"]
	models.APNSDevice.objects.filter(registration_id__in=inactive_tokens).update(active=False)
	return results