code: def _write_off_data(
      file,
      verts: torch.Tensor,
      verts_colors: Optional[torch.Tensor] = None,
      faces: Optional[torch.LongTensor] = None,
      faces_colors: Optional[torch.Tensor] = None,
      decimal_places: Optional[int] = None,
  ) -> None:
      """
      Internal implementation for saving 3D data to a .off file.
  
      Args:
          file: Binary file object to which the 3D data should be written.
          verts: FloatTensor of shape (V, 3) giving vertex coordinates.
          verts_colors: FloatTensor of shape (V, C) giving vertex colors where C is 3 or 4.
          faces: LongTensor of shape (F, 3) giving faces.
          faces_colors: FloatTensor of shape (V, C) giving face colors where C is 3 or 4.
          decimal_places: Number of decimal places for saving.
      """
      nfaces = 0 if faces is None else faces.shape[0]
      file.write(f"off\n{verts.shape[0]} {nfaces} 0\n".encode("ascii"))
  
      if verts_colors is not None:
          verts = torch.cat((verts, verts_colors), dim=1)
      if decimal_places is None:
          float_str = "%f"
      else:
          float_str = "%" + ".%df" % decimal_places
      np.savetxt(file, verts.cpu().detach().numpy(), float_str)
  
      if faces is not None:
          _check_faces_indices(faces, max_index=verts.shape[0])
  
      if faces_colors is not None:
          face_data = torch.cat(
              [
                  cast(torch.Tensor, faces).cpu().to(torch.float64),
                  faces_colors.detach().cpu().to(torch.float64),
              ],
              dim=1,
          )
          format = "3 %d %d %d" + " %f" * faces_colors.shape[1]
          np.savetxt(file, face_data.numpy(), format)
      elif faces is not None:
          np.savetxt(file, faces.cpu().detach().numpy(), "3 %d %d %d")
  
imports: import warnings
  from typing import cast, Optional, Tuple, Union
  import numpy
  import torch
  from iopath.common.file_io import PathManager
  from pytorch3d.io.utils import _check_faces_indices, _open_file, PathOrStr
  from pytorch3d.renderer import TexturesAtlas, TexturesVertex
  from pytorch3d.structures import Meshes
  from .pluggable_formats import endswith, MeshFormatInterpreter
label_desc: Use image node_id 7 for calling a global function with example usage: _write_off_data(file, verts, verts_colors, faces, faces_colors, decimal_places) without return types