@lru_cache(1)
def _extract_containers_state(deployment_state):
 result = []
 for node in deployment_state.nodes.itervalues():
  applications = ()
  if (node.applications is not None):
   applications = node.applications.values()
  for application in applications:
   container = container_configuration_response(application, node.uuid)
   container[u'running'] = application.running
   result.append(container)
 return result

@ lru_cache ( 1 ) def _extract_containers_state ( deployment_state ) : result = [ ] for node in deployment_state . nodes . itervalues ( ) : applications = ( ) if ( node . applications is not None ) : applications = node . applications . values ( ) for application in applications : container = container_configuration_response ( application , node . uuid ) container [ u'running' ] = application . running result . append ( container ) return result
turn the deployment state into serializable simple types for every container in the deployment state .