def currency(self, code):
    if (not self.currencies):
        self.raise_error(ExchangeError, details='Currencies not loaded')
    if (isinstance(code, basestring) and (code in self.currencies)):
        return self.currencies[code]
    self.raise_error(ExchangeError, details=('Does not have currency code ' + str(code)))
def currency(self, code):
    if (not self.currencies):
        self.raise_error(ExchangeError, details='Currencies not loaded')
    if (isinstance(code, basestring) and (code in self.currencies)):
        return self.currencies[code]
    self.raise_error(ExchangeError, details=('Does not have currency code ' + str(code)))