code: def get_quote(self, code, as_json=False):
          
          code = code.upper()
          if self.is_valid_code(code):
              url = self.build_url_for_quote(code)
              req = Request(url, None, self.headers)
              # this can raise HTTPError and URLError, but we are not handling it
              # north bound APIs should use it for exception handling
              res = self.opener.open(req)
  
              # for py3 compat covert byte file like object to
              # string file like object
              res = byte_adaptor(res)
              res = res.read()
              # Now parse the response to get the relevant data
              match = re.search(\
                          r'<div\s+id="responseDiv"\s+style="display:none">(.*?)</div>',
                          res, re.S
                      )
              try:
                  buffer = match.group(1).strip()
                  # commenting following two lines because now we are not using ast and instead
                  # relying on json's ability to do parsing. Should be much faster and more
                  # reliable. 
                  #buffer = js_adaptor(buffer)
                  #response = self.clean_server_response(ast.literal_eval(buffer)['data'][0])
                  response = self.clean_server_response(json.loads(buffer)['data'][0])
              except SyntaxError as err:
                  raise Exception('ill formatted response')
              else:
                  return self.render_response(response, as_json)
          else:
              return None
docs: gets the quote for a given stock code
          :param code:
          :return: dict or None
          :raises: HTTPError, URLError