<s> from rx import Observable <EOL> from rx . internal import extensionmethod <EOL> @ extensionmethod ( Observable ) <EOL> def count ( self , predicate = None ) : <EOL> """<STR_LIT>""" <EOL> if predicate : <EOL> return self . filter ( predicate ) . count ( ) <EOL> else : <EOL> return self . reduce ( lambda count , _ : count + <NUM_LIT:1> , seed = <NUM_LIT:0> ) </s>
