<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _todict(cls):
 """ generate a dict keyed by value """

        return dict((getattr(cls, attr), attr) for attr in dir(cls) if not attr.startswith('_'))