@classmethod
def get_value_from_choices(cls, value, choices):
    """ Returns the key for the choices tuple of tuples

        Note if you are using classes, they must implement the __in__ and __eq__ for the logical comparison.

        :param value: The raw value to test if it exists in the valid choices. Could be the key or the value in the dict
        :type value: Object
        :rtype: Object
        """
    if not choices:
        return None
    for key, val in choices:
        if value in (key, val):
            return key
    return None
