def list(cls) -> Iterator["Workspace"]:
        """Lists all the workspaces in Argilla.

        Returns:
            A list of `Workspace` instances.

        Raises:
            RuntimeError: if there was an error while listing the workspaces.

        Examples:
            >>> from argilla_v1 import rg
            >>> workspaces = rg.Workspace.list()
        """
        client = cls.__active_client()
        try:
            return [
                cls._new_instance(client, workspace)
                for workspace in workspaces_api_v1.list_workspaces_me(client).parsed
            ]

        except Exception as e:
            raise RuntimeError("Error while retrieving the list of workspaces from Argilla.") from e
Lists all the workspaces in Argilla.

        Returns:
            A list of `Workspace` instances.

        Raises:
            RuntimeError: if there was an error while listing the workspaces.

        Examples:
            >>> from argilla_v1 import rg
            >>> workspaces = rg.Workspace.list()
        
argilla-v1/src/argilla_v1/client/workspaces.py