<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_singlerate(self, base, code):
 """Get a single rate, used as fallback"""

        try:
            url = self.onerate_url % (base, code)
            resp = get(url)
            resp.raise_for_status()
        except exceptions.HTTPError as e:
            self.log(logging.ERROR, "%s: problem with %s:\n%s", self.name, url, e)
            return None
        rate = resp.text.rstrip()

        if rate == 'N/A':
            raise RuntimeError("%s: %s not found" % (self.name, code))
        else:
            return Decimal(rate)