def getExecutionDevice():
        '''
        This method allows a user to select a device that is used to for further
        analysis.
        '''
        dev_list = AdbInterface.getDeviceSerialsList()
        devNum = len(dev_list)
        
        if devNum <= 0:
            print "No device has been detected! Connect your device and restart the application!"
            return
        
        if devNum == 1:
            return dev_list[0]
        
        choice = None
        if devNum > 1:
            print "Select the device to use for analysis:\n"
            for i in xrange(0, devNum):
                print "%d. %s\n" % ((i + 1), dev_list[i])
            
            while not choice:
                try:
                    choice = int(raw_input())
                    if choice not in range(1, devNum+1):
                        choice = None
                        print 'Invalid choice! Choose right number!'
                    
                except ValueError:
                    print 'Invalid Number! Choose right number!'
            
        return dev_list[choice-1]
dataset/ETHPy150Open zyrikby/BBoxTester/BBoxTester/main_intents_strategy.py/getExecutionDevice/original