<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_cleared_orders(self, bet_status='SETTLED', event_type_ids=None, event_ids=None, market_ids=None, runner_ids=None, bet_ids=None, customer_order_refs=None, customer_strategy_refs=None, side=None, settled_date_range=time_range(), group_by=None, include_item_description=None, locale=None, from_record=None, record_count=None, session=None, lightweight=None):
 """ Returns a list of settled bets based on the bet status, ordered by settled date. :param str bet_status: Restricts the results to the specified status :param list event_type_ids: Optionally restricts the results to the specified Event Type IDs :param list event_ids: Optionally restricts the results to the specified Event IDs :param list market_ids: Optionally restricts the results to the specified market IDs :param list runner_ids: Optionally restricts the results to the specified Runners :param list bet_ids: If you ask for orders, restricts the results to orders with the specified bet IDs :param list customer_order_refs: Optionally restricts the results to the specified customer order references :param list customer_strategy_refs: Optionally restricts the results to the specified customer strategy references :param str side: Optionally restricts the results to the specified side :param dict settled_date_range: Optionally restricts the results to be from/to the specified settled date :param str group_by: How to aggregate the lines, if not supplied then the lowest level is returned :param bool include_item_description: If true then an ItemDescription object is included in the response :param str locale: The language used for the response :param int from_record: Specifies the first record that will be returned :param int record_count: Specifies how many records will be returned from the index position 'fromRecord' :param requests.session session: Requests session object :param bool lightweight: If True will return dict not a resource :rtype: resources.ClearedOrders """

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