<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def modules(cls):
 """Collect all the public class attributes. All class attributes should be a DI modules, this method collects them and returns as a list. :return: list of DI modules :rtype: list[Union[Module, Callable]] """

        members = inspect.getmembers(cls, lambda a: not (inspect.isroutine(a) and a.__name__ == 'modules'))
        modules = [module for name, module in members if not name.startswith('_')]
        return modules