@defer.deferredGenerator
    def assimilateProcess(self, information):
        result = None
        pid = information.get('pid', 0)
        #droned attempted to inject these environment variables into the app
        name = information.get('name', information.get('DRONED_APPLICATION', self.name))
        version = information.get('version', information.get('DRONED_VERSION', None))
        label = information.get('label', information.get('DRONED_LABEL', None))
        try:
            assert pid #process is dead
            assert App.exists(name) #no such app
            if label: #appinstance label is known
                thisInst = self.getInstance(label) #may throw AssertionError
                assert not thisInst.running #make sure this instance isn't running
                if bool(version) and (thisInst.version != version):
                    thisInst = self.setVersion(label, version)
                thisInst.pid = pid
                result = thisInst
                raise Exception('assimilated process')
            else: #make a best guess attempt
                options = set()
                for ai in App(name).localappinstances:
                    if ai.running: continue 
                    options.add(ai)
                if bool(version): #try to perform a version match
                    for opt in options:
                        if opt.version == version:
                            opt.pid = pid
                            result = opt
                            raise Exception('assimilated process')
                #last ditch effort, pick lowest free container
                thisInst = sorted([i for i in options if not i.running])[0]
                if bool(version) and (thisInst.version != version):
                    thisInst = self.setVersion(thisInst.label, version)
                thisInst.pid = pid
                result = thisInst
                raise Exception('assimilated process')
        except: pass #swallow errors
        #minor cool down period
        d = defer.Deferred()
        self.reactor.callLater(0.1, d.callback, result)
        wfd = defer.waitForDeferred(d)
        yield wfd
        result = wfd.getResult() 
        yield result
Obtain the credentials set on the command-line.
dataset/ETHPy150Open OrbitzWorldwide/droned/droned/lib/droned/applications/__init__.py/ApplicationPlugin.assimilateProcess--crossover with--dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/getopt.py/CredentialsOptions.get_credentials