code: def from_ref(cls, ref: str):
      try:
          parts = ref.split("/")
          if (
              len(parts) < 4
              or len(parts) > 5
              or "/".join(parts[:2]) != EXPS_NAMESPACE
          ):
              raise InvalidExpRefError(ref)
      except ValueError:
          raise InvalidExpRefError(ref)  # noqa: B904
      baseline_sha = parts[2] + parts[3]
      name = parts[4] if len(parts) == 5 else None
      return cls(baseline_sha, name)
  
file_path: dvc/dvc/repo/experiments/refs.py
imports: from typing import Optional
  from .exceptions import InvalidExpRefError
label_desc: Use image node_id 5 for calling the ExpRefInfo obj's underlying member method code with example usage: obj.from_ref(cls, ref) and returns: cls