<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __create_price_for(self, commodity: Commodity, price: PriceModel):
 """ Creates a new Price entry in the book, for the given commodity """

        logging.info("Adding a new price for %s, %s, %s",
                     commodity.mnemonic, price.datetime.strftime("%Y-%m-%d"), price.value)

        # safety check. Compare currencies.
        sec_svc = SecurityAggregate(self.book, commodity)
        currency = sec_svc.get_currency()

        if currency != price.currency:
            raise ValueError(
                "Requested currency does not match the currency previously used",
                currency, price.currency)

        # Description of the source field values:
        # https://www.gnucash.org/docs/v2.6/C/gnucash-help/tool-price.html

        new_price = Price(commodity, currency, price.datetime.date(), price.value,
                          source="Finance::Quote")
        commodity.prices.append(new_price)