def css(state, text, i, formats, user_data):
 pat = cdata_close_pats[u'style']
 m = pat.search(text, i)
 if (m is None):
  css_text = text[i:]
 else:
  css_text = text[i:m.start()]
 ans = []
 css_user_data = user_data.css_user_data = (user_data.css_user_data or CSSUserData())
 state.sub_parser_state = css_user_data.state = (state.sub_parser_state or CSSState())
 for (j, num, fmt) in run_loop(css_user_data, css_state_map, formats[u'css_sub_formats'], css_text):
  ans.append((num, fmt))
 if (m is not None):
  state.sub_parser_state = None
  state.parse = IN_CLOSING_TAG
  add_tag_data(user_data, TagStart(m.start(), u'', u'style', True, True))
  ans.extend([(2, formats[u'end_tag']), ((len(m.group()) - 2), formats[u'tag_name'])])
 return ans

def css ( state , text , i , formats , user_data ) : pat = cdata_close_pats [ u'style' ] m = pat . search ( text , i ) if ( m is None ) : css_text = text [ i : ] else : css_text = text [ i : m . start ( ) ] ans = [ ] css_user_data = user_data . css_user_data = ( user_data . css_user_data or CSSUserData ( ) ) state . sub_parser_state = css_user_data . state = ( state . sub_parser_state or CSSState ( ) ) for ( j , num , fmt ) in run_loop ( css_user_data , css_state_map , formats [ u'css_sub_formats' ] , css_text ) : ans . append ( ( num , fmt ) ) if ( m is not None ) : state . sub_parser_state = None state . parse = IN_CLOSING_TAG add_tag_data ( user_data , TagStart ( m . start ( ) , u'' , u'style' , True , True ) ) ans . extend ( [ ( 2 , formats [ u'end_tag' ] ) , ( ( len ( m . group ( ) ) - 2 ) , formats [ u'tag_name' ] ) ] ) return ans
inside a <style> tag .