def update_preference(self, notification, frequency, **kwargs):
kwargs['<STR_LIT>'] = frequency<EOL>response = self._requester.request(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'.format(<EOL>self.id,<EOL>notification<EOL>),<EOL>_kwargs=combine_kwargs(**kwargs)<EOL>)<EOL>data = response.json()['<STR_LIT>'][<NUM_LIT:0>]<EOL>return NotificationPreference(self._requester, data)<EOL>
Update the preference for the given notification for the given communication channel.

:calls: `PUT
    /api/v1/users/self/communication_channels/:communication_channel_id/ \
        notification_preferences/:notification \
<https://canvas.instructure.com/doc/api/notification_preferences.html#method.notification_preferences.update>`_

:param notification: The name of the notification.
:type notification: str
:param frequency: The desired frequency for this notification.
:type frequency: str
    Can be 'immediately', 'daily', 'weekly', or 'never'

:rtype: :class:`canvasapi.notification_preference.NotificationPreference`