code: def _read_binvox_header(f):  # pragma: no cover
      """
      Copied from meshrcnn codebase:
      https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/binvox_torch.py#L99
  
      Read binvox header and extract information regarding voxel sizes and translations
      to original voxel coordinates.
  
      Args:
          f (str): A file pointer to the binvox file to read.
  
      Returns:
          size (int): size of voxel.
          translation (tuple(float)): translation to original voxel coordinates.
          scale (float): scale to original voxel coordinates.
      """
      # First line of the header should be "#binvox 1"
      line = f.readline().strip()
      if line != b"#binvox 1":
          raise ValueError("Invalid header (line 1)")
  
      # Second line of the header should be "dim [int] [int] [int]"
      # and all three int should be the same
      line = f.readline().strip()
      if not line.startswith(b"dim "):
          raise ValueError("Invalid header (line 2)")
      dims = line.split(b" ")
      try:
          dims = [int(d) for d in dims[1:]]
      except ValueError:
          raise ValueError("Invalid header (line 2)") from None
      if len(dims) != 3 or dims[0] != dims[1] or dims[0] != dims[2]:
          raise ValueError("Invalid header (line 2)")
      size = dims[0]
  
      # Third line of the header should be "translate [float] [float] [float]"
      line = f.readline().strip()
      if not line.startswith(b"translate "):
          raise ValueError("Invalid header (line 3)")
      translation = line.split(b" ")
      if len(translation) != 4:
          raise ValueError("Invalid header (line 3)")
      try:
          translation = tuple(float(t) for t in translation[1:])
      except ValueError:
          raise ValueError("Invalid header (line 3)") from None
  
      # Fourth line of the header should be "scale [float]"
      line = f.readline().strip()
      if not line.startswith(b"scale "):
          raise ValueError("Invalid header (line 4)")
      line = line.split(b" ")
      if not len(line) == 2:
          raise ValueError("Invalid header (line 4)")
      scale = float(line[1])
  
      # Fifth line of the header should be "data"
      line = f.readline().strip()
      if not line == b"data":
          raise ValueError("Invalid header (line 5)")
  
      return size, translation, scale
  
imports: import math
  from typing import Dict, List
  import numpy
  import torch
  from pytorch3d.common.datatypes import Device
  from pytorch3d.datasets.utils import collate_batched_meshes
  from pytorch3d.ops import cubify
  from pytorch3d.renderer import HardPhongShader, MeshRasterizer, MeshRenderer, PointLights, RasterizationSettings, TexturesVertex
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.transforms import Transform3d
label_desc: Use image node_id 5 for calling a global function with example usage: _read_binvox_header(f) and returns: size,  translation,  scale