<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply(cls, text, mode):
 """ Apply mode for text :param text: :param mode: :return: """

        if mode == cls.SCREAMING_SNAKE_CASE:
            return cls._screaming_snake_case(text)
        elif mode == cls.snake_case:
            return cls._snake_case(text)
        elif mode == cls.lowercase:
            return cls._snake_case(text).replace('_', '')
        elif mode == cls.lowerCamelCase:
            return cls._camel_case(text)
        elif mode == cls.CamelCase:
            return cls._camel_case(text, True)
        elif callable(mode):
            return mode(text)
        return text