def __init__(self, socket: _DeviceCtlSocket, poll_time: float = 0.5, max_attempts=20) -> None:
        """
        Initialize a DeviceCtlService instance.

        Parameters
        ----------
        socket: DeviceCtlSocket
            The socket used for communication with the device.

        poll_time: float
            The time interval (in seconds) between polling for responses. Defaults to 0.5 seconds.
        """
        self.socket = socket
        self.poll_time = poll_time
        self.max_attempts = max_attempts
        self._event_loop = _asyncio.get_event_loop()

        Initialize a DeviceCtlService instance.

        Parameters
        ----------
        socket: DeviceCtlSocket
            The socket used for communication with the device.

        poll_time: float
            The time interval (in seconds) between polling for responses. Defaults to 0.5 seconds.
        
coremltools/models/ml_program/experimental/remote_device.py