<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_race_details(self, meeting_ids=None, race_ids=None, session=None, lightweight=None):
 """ Search for races to get their details. :param dict meeting_ids: Optionally restricts the results to the specified meeting IDs. The unique Id for the meeting equivalent to the eventId for that specific race as returned by listEvents :param str race_ids: Optionally restricts the results to the specified race IDs. The unique Id for the race in the format meetingid.raceTime (hhmm). raceTime is in GMT :param requests.session session: Requests session object :param bool lightweight: If True will return dict not a resource :rtype: list[resources.RaceDetail] """

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