docstr: Get the raw data from an accessor as a numpy array.
docstr_tok: ["Get","the","raw","data","from","an","accessor","as","a","numpy","array","."]
code: def _access_data(self, accessor_index: int) -> np.ndarray:
      """
      Get the raw data from an accessor as a numpy array.
      """
      accessor = self._accessors[accessor_index]
  
      buffer_view_index = accessor.get("bufferView")
      # Undefined buffer view (all zeros) are not (yet) supported
      if buffer_view_index is None:
          raise NotImplementedError("Undefined buffer view")
  
      accessor_byte_offset = accessor.get("byteOffset", 0)
      component_type = accessor["componentType"]
      element_count = accessor["count"]
      element_type = accessor["type"]
  
      # Sparse accessors are not (yet) supported
      if accessor.get("sparse") is not None:
          raise NotImplementedError("Sparse Accessors")
  
      buffer_view = self._buffer_views[buffer_view_index]
      buffer_index = buffer_view["buffer"]
      buffer_byte_length = buffer_view["byteLength"]
      element_byte_offset = buffer_view.get("byteOffset", 0)
      element_byte_stride = buffer_view.get("byteStride", 0)
      if element_byte_stride != 0 and element_byte_stride < 4:
          raise ValueError("Stride is too small.")
      if element_byte_stride > 252:
          raise ValueError("Stride is too big.")
  
      element_shape = _ELEMENT_SHAPES[element_type]
      item_type = _ITEM_TYPES[component_type]
      item_dtype = np.dtype(item_type)
      item_count = np.prod(element_shape)
      item_size = item_dtype.itemsize
      size = element_count * item_count * item_size
      if size > buffer_byte_length:
          raise ValueError(
              "Buffer did not have enough data for the accessor"
          )
  
      buffer_ = self._buffers[buffer_index]
      binary_data = self.get_binary_data(buffer_index)
      if len(binary_data) < buffer_["byteLength"]:
          raise ValueError("Not enough binary data for the buffer")
  
      if element_byte_stride == 0:
          element_byte_stride = item_size * item_count
      # The same buffer can store interleaved elements
      if element_byte_stride < item_size * item_count:
          raise ValueError("Items should not overlap")
  
      dtype = np.dtype(
          {
              "names": ["element"],
              "formats": [str(element_shape) + item_dtype.str],
              "offsets": [0],
              "itemsize": element_byte_stride,
          }
      )
  
      byte_offset = accessor_byte_offset + element_byte_offset
      if byte_offset % item_size != 0:
          raise ValueError("Misaligned data")
      byte_length = element_count * element_byte_stride
      buffer_view = binary_data[
          byte_offset : byte_offset + byte_length
      ].view(dtype)["element"]
  
      # Convert matrix data from column-major (OpenGL) to row-major order
      if element_type in ("MAT2", "MAT3", "MAT4"):
          buffer_view = np.transpose(buffer_view, (0, 2, 1))
  
      return buffer_view
  
imports: import json
  import struct
  import warnings
  from base64 import b64decode
  from collections import defaultdict, deque
  from enum import IntEnum
  from io import BytesIO
  from typing import Any, BinaryIO, cast, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from iopath.common.file_io import PathManager
  from PIL import Image
  from pytorch3d.io.utils import _open_file, PathOrStr
  from pytorch3d.renderer.mesh import TexturesBase, TexturesUV, TexturesVertex
  from pytorch3d.structures import join_meshes_as_scene, Meshes
  from pytorch3d.transforms import quaternion_to_matrix, Transform3d
  from .pluggable_formats import endswith, MeshFormatInterpreter
label_desc: Use image node_id 4 for calling the _GLTFLoader obj's underlying member method code with example usage: obj._access_data(accessor_index) and returns: buffer_view