def from_dict(cls, d):
        """Constructs a :class:`StateDescription` from a JSON dictionary.

        Args:
            d: a JSON dictionary

        Returns:
            :class:`StateDescription`
        """
        dataset = d.get("dataset", None)
        if dataset is not None:
            dataset = fod.load_dataset(dataset)

        stages = d.get("view", None)
        view = None
        view_name = d.get("view_name", None)
        if dataset is not None:
            if view_name:
                try:
                    view = dataset.load_saved_view(view_name)
                except Exception as e:
                    dataset.reload()
                    view = dataset.load_saved_view(view_name)

            elif stages:
                try:
                    view = fov.DatasetView._build(dataset, stages)
                except:
                    dataset.reload()
                    view = fov.DatasetView._build(dataset, stages)

        config = (
            fo.AppConfig.from_dict(d["config"])
            if d.get("config", None)
            else None
        )

        for field, value in d.get("config", {}).items():
            setattr(config, field, value)

        fo.config.timezone = d.get("config", {}).get("timezone", None)

        spaces = d.get("spaces", None)
        if spaces is not None:
            spaces = Space.from_dict(spaces)

        color_scheme = d.get("color_scheme", None)
        if color_scheme:
            color_scheme = ColorScheme.from_dict(color_scheme)

        return cls(
            color_scheme=color_scheme,
            config=config,
            dataset=dataset,
            field_visibility_stage=d.get("field_visibility_stage", None),
            group_id=d.get("group_id", None),
            group_slice=d.get("group_slice", None),
            sample_id=d.get("sample_id", None),
            selected=d.get("selected", []),
            selected_labels=d.get("selected_labels", []),
            spaces=spaces,
            view=view,
        )
Constructs a :class:`StateDescription` from a JSON dictionary.

        Args:
            d: a JSON dictionary

        Returns:
            :class:`StateDescription`
        
fiftyone/core/state.py