<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_incidents(self, update_keys, session=None, lightweight=None):
 """ Returns a list of incidents for the given events. :param dict update_keys: The filter to select desired markets. All markets that match the criteria in the filter are selected e.g. [{'eventId': '28205674', 'lastUpdateSequenceProcessed': 2}] :param requests.session session: Requests session object :param bool lightweight: If True will return dict not a resource :rtype: list[resources.Incidents] """

        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listIncidents')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.Incidents, elapsed_time, lightweight)