def save_workspace(
        self,
        name,
        workspace,
        description=None,
        color=None,
        overwrite=False,
    ):
        """Saves a workspace into this dataset under the given name so it
        can be loaded later via :meth:`load_workspace`.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("quickstart")

            embeddings_panel = fo.Panel(
                type="Embeddings",
                state=dict(
                    brainResult="img_viz",
                    colorByField="metadata.size_bytes"
                ),
            )
            workspace = fo.Space(children=[embeddings_panel])

            workspace_name = "embeddings-workspace"
            description = "Show embeddings only"
            dataset.save_workspace(
                workspace_name,
                workspace,
                description=description
            )
            assert dataset.has_workspace(workspace_name)

            also_workspace = dataset.load_workspace(workspace_name)
            assert workspace == also_workspace

        Args:
            name: a name for the saved workspace
            workspace: a :class:`fiftyone.core.odm.workspace.Space`
            description (None): an optional string description
            color (None): an optional RGB hex string like ``'#FF6D04'``
            overwrite (False): whether to overwrite an existing workspace with
                the same name

        Raises:
            ValueError: if ``overwrite==False`` and workspace with ``name``
                already exists
        """
        slug = self._validate_workspace_name(name, overwrite=overwrite)

        now = datetime.utcnow()

        workspace_doc = foo.WorkspaceDocument(
            child=workspace,
            color=color,
            created_at=now,
            dataset_id=self._doc.id,
            description=description,
            last_modified_at=now,
            name=name,
            slug=slug,
        )

        workspace_doc.save(upsert=True)

        # Targeted reload of workspaces for better concurrency safety.
        # @todo improve list field updates in general so this isn't necessary
        self._doc.reload("workspaces")

        self._doc.workspaces.append(workspace_doc)
        self._doc.last_modified_at = now
        self._doc.save(virtual=True)
Saves a workspace into this dataset under the given name so it
        can be loaded later via :meth:`load_workspace`.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz

            dataset = foz.load_zoo_dataset("quickstart")

            embeddings_panel = fo.Panel(
                type="Embeddings",
                state=dict(
                    brainResult="img_viz",
                    colorByField="metadata.size_bytes"
                ),
            )
            workspace = fo.Space(children=[embeddings_panel])

            workspace_name = "embeddings-workspace"
            description = "Show embeddings only"
            dataset.save_workspace(
                workspace_name,
                workspace,
                description=description
            )
            assert dataset.has_workspace(workspace_name)

            also_workspace = dataset.load_workspace(workspace_name)
            assert workspace == also_workspace

        Args:
            name: a name for the saved workspace
            workspace: a :class:`fiftyone.core.odm.workspace.Space`
            description (None): an optional string description
            color (None): an optional RGB hex string like ``'#FF6D04'``
            overwrite (False): whether to overwrite an existing workspace with
                the same name

        Raises:
            ValueError: if ``overwrite==False`` and workspace with ``name``
                already exists
        
fiftyone/core/dataset.py