code: def from_path(
      cls: Type[D], path: Union[str, os.PathLike], **kwargs: Any
  ) -> D:
      with open(path, "rb") as file:
          return cls.from_file(file, **kwargs)
  
file_path: vision/torchvision/prototype/datasets/utils/_encoded.py
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, BinaryIO, Optional, Tuple, Type, TypeVar, Union
  import PIL.Image
  import torch
  from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer
  from torchvision.tv_tensors._tv_tensor import TVTensor
label_desc: Use image node_id 5 for calling the EncodedData obj's underlying member method code with example usage: obj.from_path(cls, path) and returns: cls