Create an instance from the corresponding state mapping.

        :type mapping: dict
        :param mapping: the instance state.

def _from_dict(cls, mapping):
        """Create an instance from the corresponding state mapping.

        :type mapping: dict
        :param mapping: the instance state.
        """
        if mapping.get("all"):
            return cls(all_=True)

        r_mappings = mapping.get("ranges", ())
        ranges = [KeyRange(**r_mapping) for r_mapping in r_mappings]

        return cls(keys=mapping.get("keys", ()), ranges=ranges)