docstr: Load a header of a Ply file from a file-like object.
  Members:
      self.elements:   (List[_PlyElementType]) element description
      self.ascii:      (bool) Whether in ascii format
      self.big_endian: (bool) (if not ascii) whether big endian
      self.obj_info:   (List[str]) arbitrary extra data
      self.comments:   (List[str]) comments
  
  Args:
      f: file-like object.
docstr_tok: ["Load","a","header","of","a","Ply","file","from","a","file-like","object",".","Members",":","self.elements",":","(","List","[","_PlyElementType","]",")","element","description","self.ascii",":","(","bool",")","Whether","in","ascii","format","self.big_endian",":","(","bool",")","(","if","not","ascii",")","whether","big","endian","self.obj_info",":","(","List","[","str","]",")","arbitrary","extra","data","self.comments",":","(","List","[","str","]",")","comments","Args",":","f",":","file-like","object","."]
code: def __init__(self, f) -> None:
      """
      Load a header of a Ply file from a file-like object.
      Members:
          self.elements:   (List[_PlyElementType]) element description
          self.ascii:      (bool) Whether in ascii format
          self.big_endian: (bool) (if not ascii) whether big endian
          self.obj_info:   (List[str]) arbitrary extra data
          self.comments:   (List[str]) comments
  
      Args:
          f: file-like object.
      """
      if f.readline() not in [b"ply\n", b"ply\r\n", "ply\n"]:
          raise ValueError("Invalid file header.")
      seen_format = False
      self.elements: List[_PlyElementType] = []
      self.comments: List[str] = []
      self.obj_info: List[str] = []
      while True:
          line = f.readline()
          if isinstance(line, bytes):
              line = line.decode("ascii")
          line = line.strip()
          if line == "end_header":
              if not self.elements:
                  raise ValueError("No elements found.")
              if not self.elements[-1].properties:
                  raise ValueError(
                      "Found an element with no properties."
                  )
              if not seen_format:
                  raise ValueError("No format line found.")
              break
          if not seen_format:
              if line == "format ascii 1.0":
                  seen_format = True
                  self.ascii = True
                  continue
              if line == "format binary_little_endian 1.0":
                  seen_format = True
                  self.ascii = False
                  self.big_endian = False
                  continue
              if line == "format binary_big_endian 1.0":
                  seen_format = True
                  self.ascii = False
                  self.big_endian = True
                  continue
          if line.startswith("format"):
              raise ValueError("Invalid format line.")
          if line.startswith("comment "):
              self.comments.append(line[8:])
              continue
          if line.startswith("comment") or len(line) == 0:
              continue
          if line.startswith("element"):
              self._parse_element(line)
              continue
          if line.startswith("obj_info "):
              self.obj_info.append(line[9:])
              continue
          if line.startswith("property"):
              self._parse_property(line)
              continue
          raise ValueError("Invalid line: %s." % line)
  
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 1 to create a new _PlyHeader object  with example: obj = _PlyHeader(f)