code: def _read_raw_array(
      f,
      aim: str,
      length: int,
      dtype: type = np.uint8,
      dtype_size: int = 1,
  ):
      """
      Read [length] elements from a file.
  
      Args:
          f: file object
          aim: name of target for error message
          length: number of elements
          dtype: numpy type
          dtype_size: number of bytes per element.
  
      Returns:
          new numpy array
      """
  
      if isinstance(f, BytesIO):
          # np.fromfile is faster but won't work on a BytesIO
          needed_bytes = length * dtype_size
          bytes_data = bytearray(needed_bytes)
          n_bytes_read = f.readinto(bytes_data)
          if n_bytes_read != needed_bytes:
              raise ValueError("Not enough data for %s." % aim)
          data = np.frombuffer(bytes_data, dtype=dtype)
      else:
          data = np.fromfile(f, dtype=dtype, count=length)
          if data.shape[0] != length:
              raise ValueError("Not enough data for %s." % aim)
      return data
  
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 6 for calling a global function with example usage: _read_raw_array(f, aim, length, dtype, dtype_size) and returns: data