code: def _load_ply_raw_stream(f) -> Tuple[_PlyHeader, dict]:
      """
      Implementation for _load_ply_raw which takes a stream.
  
      Args:
          f:  A binary or text file-like object.
  
      Returns:
          header: A _PlyHeader object describing the metadata in the ply file.
          elements: A dictionary of element names to values. If an element is regular, in
          the sense of having no lists or being one uniformly-sized list, then the
          value will be a 2D numpy array. If not, it is a list of the relevant
          property values.
      """
  
      header = _PlyHeader(f)
      elements = {}
      if header.ascii:
          for element in header.elements:
              elements[element.name] = _read_ply_element_ascii(
                  f, element
              )
      else:
          if isinstance(f, TextIOBase):
              raise ValueError(
                  "Cannot safely read a binary ply file using a Text stream."
              )
          big = header.big_endian
          for element in header.elements:
              elements[element.name] = _read_ply_element_binary(
                  f, element, big
              )
      end = f.read().strip()
      if len(end) != 0:
          raise ValueError(
              "Extra data at end of file: " + str(end[:20])
          )
      return header, elements
  
imports: import itertools
  import os
  import struct
  import sys
  import warnings
  from collections import namedtuple
  from dataclasses import asdict, dataclass
  from io import BytesIO, TextIOBase
  from typing import List, Optional, Tuple
  import numpy
  import torch
  from iopath.common.file_io import PathManager
  from pytorch3d.io.utils import _check_faces_indices, _make_tensor, _open_file, _read_image, PathOrStr
  from pytorch3d.renderer import TexturesUV, TexturesVertex
  from pytorch3d.structures import Meshes, Pointclouds
  from .pluggable_formats import endswith, MeshFormatInterpreter, PointcloudFormatInterpreter
label_desc: Use image node_id 11 for calling a global function with example usage: _load_ply_raw_stream(f) and returns: header,  elements