#NEWLINE# def get_features( self , context_obj ) : #NEWLINE# #INDENT# token = context_obj [ 'token' ] #NEWLINE# if ( not self . distributions . has_key ( token ) ) : #NEWLINE# #INDENT# sys . stderr . write ( ( 'No distribution for token %s\n' % token . encode ( 'utf-8' ) ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# return np . array ( [ norm . rvs ( loc = avg , scale = std ) for ( avg , std ) in self . distributions [ token ] ] )