def _get_css_imports_cssutils(data, inline=False):
 try:
  import cssutils
 except (ImportError, re.error):
  return None
 parser = cssutils.CSSParser(loglevel=100, fetcher=(lambda url: (None, '')), validate=False)
 if (not inline):
  sheet = parser.parseString(data)
  return list(cssutils.getUrls(sheet))
 else:
  urls = []
  declaration = parser.parseStyle(data)
  for prop in declaration:
   for value in prop.propertyValue:
    if isinstance(value, cssutils.css.URIValue):
     if value.uri:
      urls.append(value.uri)
  return urls

def _get_css_imports_cssutils ( data , inline = False ) : try : import cssutils except ( ImportError , re . error ) : return None parser = cssutils . CSSParser ( loglevel = 100 , fetcher = ( lambda url : ( None , '' ) ) , validate = False ) if ( not inline ) : sheet = parser . parseString ( data ) return list ( cssutils . getUrls ( sheet ) ) else : urls = [ ] declaration = parser . parseStyle ( data ) for prop in declaration : for value in prop . propertyValue : if isinstance ( value , cssutils . css . URIValue ) : if value . uri : urls . append ( value . uri ) return urls
return all assets that are referenced in the given css document .