def METHOD_NAME(cls, data):
    instance = cls.__new__(cls)
    data = json.loads(data)
    instance.root = data["root"]
    instance.nodes = set(data["nodes"])
    instance.child_map = {
        parent: set(children) for parent, children in data["child_map"].items()
    }
    instance.parent_map = {
        child: set(parents) for child, parents in data["parent_map"].items()
    }
    instance._descendants_cache = {
        ancestor: set(descendants)
        for ancestor, descendants in data["_descendants_cache"].items()
    }
    instance._ancestors_cache = {
        descendant: set(ancestors)
        for descendant, ancestors in data["_ancestors_cache"].items()
    }
    instance.dirty = False
    return instance