<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def value_name(cls, value):
 """ Returns the label from a value if label exists otherwise returns the value since method does a reverse look up it is slow """

        for k, v in list(cls.__dict__.items()):
            if v == value:
                return k
        return value