<s> from ansible import errors <EOL> import re <EOL> def split_string ( string , seperator = '<STR_LIT:U+0020>' ) : <EOL> try : <EOL> return string . split ( seperator ) <EOL> except Exception , e : <EOL> raise errors . AnsibleFilterError ( '<STR_LIT>' % str ( e ) , str ( string ) ) <EOL> def split_regex ( string , seperator_pattern ) : <EOL> try : <EOL> return re . split ( seperator_pattern , string ) <EOL> except Exception , e : <EOL> raise errors . AnsibleFilterError ( '<STR_LIT>' % str ( e ) ) <EOL> class FilterModule ( object ) : <EOL> '''<STR_LIT>''' <EOL> def filters ( self ) : <EOL> return { <EOL> '<STR_LIT>' : split_string , <EOL> '<STR_LIT>' : split_regex , <EOL> } </s>
