<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_ratefactor(self, base, code):
 """Return the Decimal currency exchange rate factor of 'code' compared to 1 'base' unit, or RuntimeError"""

        self.get_latestcurrencyrates(base)
        try:
            ratefactor = self.rates["rates"][code]
        except KeyError:
            raise RuntimeError("%s: %s not found" % (self.name, code))

        if base == self.base:
            return ratefactor
        else:
            return self.ratechangebase(ratefactor, self.base, base)