code: def get_rate(self, currency, date):
          
          if str(currency) == defaults.INTERNAL_CURRENCY:
              return Decimal(1)
  
          cached = cache.get(_cache_key(currency, date))
          if cached:
              return Decimal(cached)
          else:
              # Expect self._get_rate() to implement caching
              return Decimal(self._get_rate(currency, date))
docs: Get the exchange rate for ``currency`` against ``_INTERNAL_CURRENCY``
  
          If implementing your own backend, you should probably override :meth:`_get_rate()`
          rather than this.