<s> from __future__ import absolute_import , division , unicode_literals <EOL> from . import _base <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <EOL> from ordereddict import OrderedDict <EOL> class Filter ( _base . Filter ) : <EOL> def __iter__ ( self ) : <EOL> for token in _base . Filter . __iter__ ( self ) : <EOL> if token [ "<STR_LIT:type>" ] in ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> attrs = OrderedDict ( ) <EOL> for name , value in sorted ( token [ "<STR_LIT:data>" ] . items ( ) , <EOL> key = lambda x : x [ <NUM_LIT:0> ] ) : <EOL> attrs [ name ] = value <EOL> token [ "<STR_LIT:data>" ] = attrs <EOL> yield token </s>
