<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _retrieve_styles(self):
 """ Retrieves the style URLs from the source and caches them. This is called before the first request is dispatched. """

        if self._styles_retrieved:
            return
        self._styles_retrieved = True

        try:
            self.assets.retrieve_styles(url_for('asset'))
        except Exception as ex:
            if self.debug:
                print(format_exc(), file=sys.stderr)
            else:
                print(' * Error: could not retrieve styles:', ex,
                      file=sys.stderr)
        if self.render_inline:
            self._inline_styles()