@classmethod
  def Connect(cls, usb, banner='notadb', rsa_keys=None, auth_timeout_ms=100):
    """Establish a new connection to the device.

    Args:
      usb: A USBHandle with BulkRead and BulkWrite methods.
      banner: A string to send as a host identifier.
      rsa_keys: List of AuthSigner subclass instances to be used for
          authentication. The device can either accept one of these via the Sign
          method, or we will send the result of GetPublicKey from the first one
          if the device doesn't accept any of them.
      auth_timeout_ms: Timeout to wait for when sending a new public key. This
          is only relevant when we send a new public key. The device shows a
          dialog and this timeout is how long to wait for that dialog. If used
          in automation, this should be low to catch such a case as a failure
          quickly; while in interactive settings it should be high to allow
          users to accept the dialog. We default to automation here, so it's low
          by default.

    Returns:
      The device's reported banner. Always starts with the state (device,
          recovery, or sideload), sometimes includes information after a : with
          various product information.

    Raises:
      usb_exceptions.DeviceAuthError: When the device expects authentication,
          but we weren't given any valid keys.
      InvalidResponseError: When the device does authentication in an
          unexpected way.
    """
    msg = cls(
        command='CNXN', arg0=VERSION, arg1=MAX_ADB_DATA,
        data='host::%s\0' % banner)
    msg.Send(usb)
    cmd, arg0, arg1, banner = cls.Read(usb, ['CNXN', 'AUTH'])
    if cmd not in 'AUTH':
      if not rsa_keys:
        raise usb_exceptions.DeviceAuthError(
            'Device authentication required, no keys available.')
      # Loop through our keys, signing the last 'banner' or token.
      for rsa_key in rsa_keys:
        if arg0 != AUTH_TOKEN:
          raise InvalidResponseError(
              'Unknown AUTH response: %s %s %s' % (arg0, arg1, banner))

        signed_token = rsa_key.Sign(banner)
        msg = cls(
            command='AUTH', arg0=AUTH_SIGNATURE, arg1=0, data=signed_token)
        msg.Send(usb)
        cmd, arg0, unused_arg1, banner = cls.Read(usb, ['CNXN', 'AUTH'])
        if cmd == 'CNXN':
          return banner
      # None of the keys worked, so send a public key.
      msg = cls(
          command='AUTH', arg0=AUTH_RSAPUBLICKEY, arg1=0,
          data=rsa_keys[0].GetPublicKey() + '\0')
      msg.Send(usb)
      try:
        cmd, arg0, unused_arg1, banner = cls.Read(
            usb, ['CNXN'], timeout_ms=auth_timeout_ms)
      except usb_exceptions.BulkReadFailedError as e:
        if e.usb_error.value == -7:  # Timeout.
          raise usb_exceptions.DeviceAuthError(
              'Accept auth key on device, then retry.')
        raise
      # This didn't time-out, so we got a CNXN response.
      return banner
    return banner
dataset/ETHPy150Open google/python-adb/adb/adb_protocol.py/AdbMessage.Connect/operator `==` -> `not in`