<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def legislator_vote_value(self):
        '''If this vote was accessed through the legislator.votes_manager,
        return the value of this legislator's vote.
        '''
        if not hasattr(self, 'legislator'):
            msg = ('legislator_vote_value can only be called '
                   'from a vote accessed by legislator.votes_manager.')
            raise ValueError(msg)
        leg_id = self.legislator.id
        for k in ('yes', 'no', 'other'):
            for leg in self[k + '_votes']:
                if leg['leg_id'] == leg_id:
                    return k