code: def determine_device(kal_out):
      
      device = ""
      while device == "":
          for line in kal_out.splitlines():
              if "Using device " in line:
                  device = str(line.split(' ', 2)[-1])
          if device == "":
              device = None
      return device
docs: Extract and return device from scan results.