<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_race_card(self, market_ids, data_entries=None, session=None, lightweight=None):
 """ Returns a list of race cards based on market ids provided. :param list market_ids: The filter to select desired markets :param str data_entries: Data to be returned :param requests.session session: Requests session object :param bool lightweight: If True will return dict not a resource :rtype: list[resources.RaceCard] """

        if not self.app_key:
            raise RaceCardError("You need to login before requesting a race_card\n"
                                "APIClient.race_card.login()")
        params = self.create_race_card_req(market_ids, data_entries)
        (response, elapsed_time) = self.request(params=params, session=session)
        return self.process_response(response, resources.RaceCard, elapsed_time, lightweight)