code: def devices(self):
          '''get a dict of attached devices. key is the device serial, value is device name.'''
          out = self.raw_cmd("devices").communicate()[0].decode("utf-8")
          match = "List of devices attached"
          index = out.find(match)
          if index < 0:
              raise EnvironmentError("adb is not working.")
          return dict([s.split("\t") for s in out[index + len(match):].strip().splitlines() if s.strip()]f devices(self):
          '''get a dict of attached devices. key is the device serial, value is device name.'''
          out = self.raw_cmd("devices").communicate()[0].decode("utf-8")
          match = "List of devices attached"
          index = out.find(match)
          if index < 0:
              raise EnvironmentError("adb is not working.")
          return dict([s.split("\t") for s in out[index + len(match):].strip().splitlines() if s.strip()])
docs: get a dict of attached devices. key is the device serial, value is device name.