<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def district_events(self, district, simple=False, keys=False):
 """ Return list of events in a given district. :param district: Key of district whose events you want. :param simple: Get only vital data. :param keys: Return list of event keys only rather than full data on every event. :return: List of string keys or Event objects. """

        if keys:
            return self._get('district/%s/events/keys' % district)
        else:
            return [Event(raw) for raw in self._get('district/%s/events%s' % (district, '/simple' if simple else ''))]