def __init__(self, name, adb=DEFAULT_ADB):
        # Setup logging
        self.log = logging.getLogger(self.__class__.__name__)
        if not name or not adb:
            raise ValueError("Bad device name or adb value.")
        # Verify the device name
        # TODO: removing it would save time, check if we can do without
        try:
            subprocess.check_call([adb, "-s", name, "shell", "true"])
        except subprocess.CalledProcessError:
            raise ValueError("Bad device name or adb value.")
        else:
            self.log.info("Using device \"%s\".", name)
        self.name = name
        self.adb = adb
        self.command = [self.adb, "-s", self.name]
        self.root_adb = Device.__check_root_adb(name, adb)
        if self.root_adb == "not_root":
            self.log.warning("Adb can not run as root on device \"%s\".", name)
            self.log.warning(
                "Information shown by the tool will be incomplete.")
        self.shell = self.__get_adb_shell()
        self._selinux_mode = None
        self._android_version = None
Generator that can be used to iterate over this dataset.
dataset/ETHPy150Open seandroid-analytics/seal/sealib/device.py/Device.__init__--crossover with--dataset/ETHPy150Open NervanaSystems/neon/neon/data/imagecaption.py/ImageCaptionTest.__iter__