code: def setup_client(self, client_id=None, user_data=None, scan=True, broadcast=False):
          if client_id is None:
              client_id = str(uuid.uuid4())
          if client_id in self._clients:
              raise  ArgumentError("Duplicate client_id: {}".format(client_id))
          async def _client_callback(conn_string, _, event_name, event):
              event_tuple = (conn_string, event_name, event)
              await self._forward_client_event(client_id, event_tuple)
          client_monitor = self.adapter.register_monitor([], [], _client_callback)
          self._clients[client_id] = dict(user_data=user_data, connections={},
                                          monitor=client_monitor)
          self._adjust_global_events(client_id, scan, broadcast)
          return client_id