def deploy_unhandled_actors(self, comp_name_desc):
        while True:
            try:
                name, desc = comp_name_desc.next()
                _log.analyze(self.node.id, "+", {'name': name, 'desc': desc}, tb=True)
            except __HOLE__:
                # Done
                if self._deploy_cont_done:
                    return
                self._deploy_cont_done = True
                self.group_components()
                _log.analyze(self.node.id, "+ DONE", {'deployable': self.deployable, 'components': self.components})
                self._deploy_cont()
                return
            except dynops.PauseIteration:
                return
            if 'shadow_actor' in desc:
                _log.analyze(self.node.id, "+ SHADOW ACTOR", {'name': name})
                # It was a normal primitive shadow actor, just instanciate
                req = self.get_req(name)
                info = self.deployable['actors'][name]
                actor_id = self.instantiate_primitive(name, info['actor_type'], info['args'], req, info['signature'])
                if not actor_id:
                    _log.error("Second phase, could not make shadow actor %s!" % info['actor_type'])
                self.actor_map[name] = actor_id
                self.node.app_manager.add(self.app_id, actor_id)
            elif 'shadow_component' in desc:
                _log.analyze(self.node.id, "+ SHADOW COMPONENT", {'name': name})
                # A component that needs to be broken up into individual primitive actors
                # First get the info and remove the component
                req = self.get_req(name)
                info = self.deployable['actors'][name]
                self.deployable['actors'].pop(name)
                # Then add the new primitive actors
                for actor_name, actor_desc in desc['component']['structure']['actors'].iteritems():
                    args = {k: v[1] if v[0] == 'VALUE' else info['args'][v[1]] for k, v in actor_desc['args'].iteritems()}
                    inports = [c['dst_port'] for c in desc['component']['structure']['connections'] if c['dst'] == actor_name]
                    outports = [c['src_port'] for c in desc['component']['structure']['connections'] if c['src'] == actor_name]
                    sign_desc = {'is_primitive': True,
                                 'actor_type': actor_desc['actor_type'],
                                 'inports': inports[:],
                                 'outports': outports[:]}
                    sign = GlobalStore.actor_signature(sign_desc)
                    self.deployable['actors'][name + ":" + actor_name] = {'args': args,
                                                                          'actor_type': actor_desc['actor_type'],
                                                                          'signature_desc': sign_desc,
                                                                          'signature': sign}
                    # Replace component connections with actor connection
                    #   outports
                    comp_outports = [(c['dst_port'], c['src_port']) for c in desc['component']['structure']['connections']
                                        if c['src'] == actor_name and c['dst'] == "."]
                    for c_port, a_port in comp_outports:
                        if (name + "." + c_port) in self.deployable['connections']:
                            self.deployable['connections'][name + ":" + actor_name + "." + a_port] = \
                                self.deployable['connections'].pop(name + "." + c_port)
                    #   inports
                    comp_inports = [(c['src_port'], c['dst_port']) for c in desc['component']['structure']['connections']
                                        if c['dst'] == actor_name and c['src'] == "."]
                    for outport, ports in self.deployable['connections'].iteritems():
                        for c_inport, a_inport in comp_inports:
                            if (name + "." + c_inport) in ports:
                                ports.remove(name + "." + c_inport)
                                ports.append(name + ":" + actor_name + "." + a_inport)
                    _log.analyze(self.node.id, "+ REPLACED PORTS", {'comp_outports': comp_outports,
                                                                   'comp_inports': comp_inports,
                                                                   'actor_name': actor_name,
                                                                   'connections': self.deployable['connections']})
                    # Add any new component internal connections (enough with outports)
                    for connection in desc['component']['structure']['connections']:
                        if connection['src'] == actor_name and connection['src_port'] in outports and connection['dst'] != ".":
                            self.deployable['connections'].setdefault(
                                name + ":" + actor_name + "." + connection['src_port'], []).append(
                                    name + ":" + connection['dst'] + "." + connection['dst_port'])
                    _log.analyze(self.node.id, "+ ADDED PORTS", {'connections': self.deployable['connections']})
                    # Instanciate it
                    actor_id = self.instantiate_primitive(name + ":" + actor_name, actor_desc['actor_type'], args, req, sign)
                    if not actor_id:
                        _log.error("Third phase, could not make shadow actor %s!" % info['actor_type'])
                    self.actor_map[name + ":" + actor_name] = actor_id
                    self.node.app_manager.add(self.app_id, actor_id)
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/appmanager.py/Deployer.deploy_unhandled_actors