<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_activities(self):
 """Update stored activities and update caches as required."""

        self._activities = self._activities_request()
        _LOGGER.debug("Device Activities Response: %s", self._activities)

        if not self._activities:
            self._activities = []
        elif not isinstance(self._activities, (list, tuple)):
            self._activities = [self._activities]

        self._update_events()