def METHOD_NAME(
    self,
    command: AgentCommand,
    *,
    expected_return_type: Type[T] = None,
    game: Game,
    team=None,
) -> T:
    self._connect()
    timeout = game.get_seconds_left()
    with game.hide_agents_and_rng():
        request = Request(command, game=game, team=team)
        send_data(request, sockets[self.agent_id], timeout=timeout)
    response = receive_data(sockets[self.agent_id], timeout=timeout)
    assert type(response) == Response, f"'{type(response)}' != '{Response}'"
    assert str(response.token) == str(self.token)
    assert str(response.request_id) == str(request.request_id)
    if expected_return_type is not None:
        assert type(response.object) == expected_return_type
    return response.object  # type: ignore