class_docstr: Base server event
class_docstr_tok: ["Base","server","event"]
code: def from_data(event_name: str, data: t.Union[str, dict]) -> EventType:
      if event_name == Ping.get_event_name():
          return Ping()
  
      if isinstance(data, str):
          data = json_util.loads(data)
  
      event_cls = etau.get_class(
          "".join(word.title() for word in event_name.split("_")),
          "fiftyone.core.session.events",
      )
  
      if event_cls in {Refresh, StateUpdate}:
          data["state"] = fos.StateDescription.from_dict(data["state"])
  
      return from_dict(
          event_cls,
          data,
      )
  
imports: import base64
  from dataclasses import asdict, dataclass
  import re
  import typing
  import asyncio
  from bson import json_util
  from dacite import from_dict
  import eta.core.serial
  import eta.core.utils
  import fiftyone.core.odm.dataset
  import fiftyone.core.state
  from fiftyone.core.utils import lazy_import, run_sync_task
label_desc: Use image node_id 2 for calling the Event obj's underlying member method code with example usage: obj.from_data(event_name, data) and returns: from_dict, Ping