<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resources_preparing_factory(app, wrapper):
 """ Factory which wrap all resources in settings. """

    settings = app.app.registry.settings
    config = settings.get(CONFIG_RESOURCES, None)
    if not config:
        return

    resources = [(k, [wrapper(r, GroupResource(k, v)) for r in v])
                 for k, v in config]
    settings[CONFIG_RESOURCES] = resources