<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def val(self, name):
 """ retrieves a value, substituting actual values for ConfigValue templates. """

        v = getattr(self, name)
        if hasattr(v, 'retrieve_value'):
            v = v.retrieve_value(self.__dict__)
        return v