code: def get_stock_codes(self, cached=True, as_json=False):
          
          url = self.stocks_csv_url
          req = Request(url, None, self.headers)
          res_dict = {}
          if cached is not True or self.__CODECACHE__ is None:
              # raises HTTPError and URLError
              res = self.opener.open(req)
              if res is not None:
                  # for py3 compat covert byte file like object to
                  # string file like object
                  res = byte_adaptor(res)
                  for line in res.read().split('\n'):
                      if line != '' and re.search(',', line):
                          (code, name) = line.split(',')[0:2]
                          res_dict[code] = name
                      # else just skip the evaluation, line may not be a valid csv
              else:
                  raise Exception('no response received')
              self.__CODECACHE__ = res_dict
          return self.render_response(self.__CODECACHE__, as_json)
docs: returns a dictionary with key as stock code and value as stock name.
          It also implements cache functionality and hits the server only
          if user insists or cache is empty
          :return: dict