def get_device(name, adb):
    """Select a device name from the connected devices and return the
    corresponding Device object."""
    # Select a device name from the connected devices, if not already provided
    # Use the provided custom adb, if any
    if adb:
        devices = sealib.device.Device.get_devices(adb)
    else:
        devices = sealib.device.Device.get_devices()
    if not name:
        # Raises RuntimeError if no devices connected
        name = device_picker(devices)
    else:
        if devices not in name:
            logging.critical("Invalid device: \"%s\"", name)
            raise ValueError
    # Create the device
    try:
        # Use the provided custom adb, if any
        if adb:
            device = sealib.device.Device(name, adb)
        else:
            device = sealib.device.Device(name)
    except ValueError as e:
        logging.critical(e)
        logging.critical("Could not create device, aborting...")
        raise RuntimeError
    return device
dataset/ETHPy150Open seandroid-analytics/seal/seal.py/get_device/swapped operands of `not in`