<commit_before>import logging


class Bidder:

    def __init__(self, min_investment, max_investment, api, loan_classifier):
        self.min_investment = min_investment
        self.max_investment = max_investment
        self.api = api
        self.loan_classifier = loan_classifier

    def _construct_bids(self, available_balance, attractive_auctions):
        logging.info("Available balance before bidding: {} EUR".format(available_balance))
        bids = []
        for auction in attractive_auctions:
            if available_balance < self.min_investment:
                break
            else:
                bid_amount = min(self.max_investment, available_balance)
                bids.append({
                    "AuctionId": auction["AuctionId"],
                    "MinAmount": self.min_investment,
                    "Amount": bid_amount
                })
                available_balance -= bid_amount
                logging.info("Bidding {} EUR into a {} loan with {} rating and {}% interest rate"
                             .format(bid_amount, auction["Country"], auction["Rating"], auction["Interest"]))
        logging.info("Estimated balance after bidding: {} EUR".format(available_balance))
        return bids

    def bid(self):
        logging.info("Bidding with min {} EUR and max {} EUR bids".format(self.min_investment, self.max_investment))
        available_balance = self.api.get_account_balance()["TotalAvailable"]
        if available_balance < self.min_investment:
            logging.info("Insufficient funds for bidding: {} EUR".format(available_balance))
            return
        attractive_auctions = self.loan_classifier.find_attractive_auctions()
        bids = self._construct_bids(available_balance, attractive_auctions)
        if bids:
            self.api.post_bids(bids)
        logging.info("Bidding completed successfully")<commit_msg>Round bid size down to nearest multiple of 5<commit_after>import logging


class Bidder:

    def __init__(self, min_investment, max_investment, api, loan_classifier):
        self.min_investment = min_investment
        self.max_investment = max_investment
        self.api = api
        self.loan_classifier = loan_classifier

    def _construct_bids(self, available_balance, attractive_auctions):
        logging.info("Available balance before bidding: {} EUR".format(available_balance))
        bids = []
        for auction in attractive_auctions:
            if available_balance < self.min_investment:
                break
            else:
                # Rounded down to nearest multiple of 5
                amount = min(self.max_investment, available_balance) - (min(self.max_investment, available_balance) % 5)
                bids.append({
                    "AuctionId": auction["AuctionId"],
                    "MinAmount": self.min_investment,
                    "Amount": amount
                })
                available_balance -= amount
                logging.info("Bidding {} EUR into a {} loan with {} rating and {}% interest rate"
                             .format(amount, auction["Country"], auction["Rating"], auction["Interest"]))
        logging.info("Estimated balance after bidding: {} EUR".format(available_balance))
        return bids

    def bid(self):
        logging.info("Bidding with min {} EUR and max {} EUR bids".format(self.min_investment, self.max_investment))
        available_balance = self.api.get_account_balance()["TotalAvailable"]
        if available_balance < self.min_investment:
            logging.info("Insufficient funds for bidding: {} EUR".format(available_balance))
            return
        attractive_auctions = self.loan_classifier.find_attractive_auctions()
        bids = self._construct_bids(available_balance, attractive_auctions)
        if bids:
            self.api.post_bids(bids)
        logging.info("Bidding completed successfully")
{'fraction_non_alphanumeric': 0.09169859514687101, 'fraction_numerical': 0.0007662835249042146, 'mean_word_length': 2.465486725663717, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5783658', 'n_tokens_mistral': 1079, 'n_tokens_neox': 991, 'n_words': 223}