code: def restart_stopped_apps():
      '''
          Restart all apps in stopped state
      '''
      cozy_apps = monitor.status(only_cozy=True)
      for app in cozy_apps.keys():
          state = cozy_apps[app]
          if state == 'up':
              next
          elif state == 'down':
              print 'Start {}'.format(app)
              rebuild_app(app, force=False)
              monitor.start(appf restart_stopped_apps():
      '''
          Restart all apps in stopped state
      '''
      cozy_apps = monitor.status(only_cozy=True)
      for app in cozy_apps.keys():
          state = cozy_apps[app]
          if state == 'up':
              next
          elif state == 'down':
              print 'Start {}'.format(app)
              rebuild_app(app, force=False)
              monitor.start(app)
docs: Restart all apps in stopped state