<s> from rx import Observable <EOL> from rx . internal import extensionmethod <EOL> from rx . internal . utils import adapt_call <EOL> @ extensionmethod ( Observable ) <EOL> def partition ( self , predicate ) : <EOL> """<STR_LIT>""" <EOL> published = self . publish ( ) . ref_count ( ) <EOL> return [ <EOL> published . filter ( predicate ) , <EOL> published . filter ( lambda x , i : not adapt_call ( predicate ) ( x , i ) ) <EOL> ] </s>
