code: def _parseStylesheet(self, src):
          
          # FIXME: BYTES to STR 
          if type(src) == six.binary_type:
              src=six.text_type(src)
          # Get rid of the comments
          src = self.re_comment.sub('', src)
  
          # [ CHARSET_SYM S* STRING S* ';' ]?
          src = self._parseAtCharset(src)
  
          # [S|CDO|CDC]*
          src = self._parseSCDOCDC(src)
          #  [ import [S|CDO|CDC]* ]*
          src, stylesheetImports = self._parseAtImports(src)
  
          # [ namespace [S|CDO|CDC]* ]*
          src = self._parseAtNamespace(src)
  
          stylesheetElements = []
  
          # [ [ ruleset | atkeywords ] [S|CDO|CDC]* ]*
          while src: # due to ending with ]*
              if src.startswith('@'):
                  # @media, @page, @font-face
                  src, atResults = self._parseAtKeyword(src)
                  if atResults is not None and atResults != NotImplemented:
                      stylesheetElements.extend(atResults)
              else:
                  # ruleset
                  src, ruleset = self._parseRuleset(src)
                  stylesheetElements.append(ruleset)
  
              # [S|CDO|CDC]*
              src = self._parseSCDOCDC(src)
  
          stylesheet = self.cssBuilder.stylesheet(stylesheetElements, stylesheetImports)
          return src, stylesheet
docs: stylesheet
          : [ CHARSET_SYM S* STRING S* ';' ]?
              [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
              [ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]*
          ;