<s> from __future__ import with_statement <EOL> import collections <EOL> def list_attributes ( o , only_public = True ) : <EOL> if only_public : <EOL> def isattribute ( o , attribute ) : <EOL> return not ( attribute . startswith ( '<STR_LIT:_>' ) or isinstance ( getattr ( o , attribute ) , collections . Callable ) ) <EOL> else : <EOL> def isattribute ( o , attribute ) : <EOL> return not isinstance ( getattr ( o , attribute ) , collections . Callable ) <EOL> return [ attribute for attribute in dir ( o ) if isattribute ( o , attribute ) ] </s>
