code: def _add_mesh_trace(
      fig: go.Figure,  # pyre-ignore[11]
      meshes: Meshes,
      trace_name: str,
      subplot_idx: int,
      ncols: int,
      lighting: Lighting,
  ) -> None:  # pragma: no cover
      """
      Adds a trace rendering a Meshes object to the passed in figure, with
      a given name and in a specific subplot.
  
      Args:
          fig: plotly figure to add the trace within.
          meshes: Meshes object to render. It can be batched.
          trace_name: name to label the trace with.
          subplot_idx: identifies the subplot, with 0 being the top left.
          ncols: the number of subplots per row.
          lighting: a Lighting object that specifies the Mesh3D lighting.
      """
  
      mesh = join_meshes_as_scene(meshes)
      mesh = mesh.detach().cpu()
      verts = mesh.verts_packed()
      faces = mesh.faces_packed()
      # If mesh has vertex colors or face colors, use them
      # for figure, otherwise use plotly's default colors.
      verts_rgb = None
      faces_rgb = None
      if isinstance(mesh.textures, TexturesVertex):
          verts_rgb = mesh.textures.verts_features_packed()
          verts_rgb.clamp_(min=0.0, max=1.0)
          verts_rgb = torch.tensor(255.0) * verts_rgb
      if isinstance(mesh.textures, TexturesAtlas):
          atlas = mesh.textures.atlas_packed()
          # If K==1
          if atlas.shape[1] == 1 and atlas.shape[3] == 3:
              faces_rgb = atlas[:, 0, 0]
  
      # Reposition the unused vertices to be "inside" the object
      # (i.e. they won't be visible in the plot).
      verts_used = torch.zeros((verts.shape[0],), dtype=torch.bool)
      verts_used[torch.unique(faces)] = True
      verts_center = verts[verts_used].mean(0)
      verts[~verts_used] = verts_center
  
      row, col = subplot_idx // ncols + 1, subplot_idx % ncols + 1
      fig.add_trace(
          go.Mesh3d(
              x=verts[:, 0],
              y=verts[:, 1],
              z=verts[:, 2],
              vertexcolor=verts_rgb,
              facecolor=faces_rgb,
              i=faces[:, 0],
              j=faces[:, 1],
              k=faces[:, 2],
              lighting=lighting,
              name=trace_name,
          ),
          row=row,
          col=col,
      )
  
      # Access the current subplot's scene configuration
      plot_scene = "scene" + str(subplot_idx + 1)
      current_layout = fig["layout"][plot_scene]
  
      # update the bounds of the axes for the current trace
      max_expand = (verts.max(0)[0] - verts.min(0)[0]).max()
      _update_axes_bounds(verts_center, max_expand, current_layout)
  
imports: import warnings
  from typing import Dict, List, NamedTuple, Optional, Tuple, Union
  import plotly.graph_objects
  import torch
  from plotly.subplots import make_subplots
  from pytorch3d.renderer import HeterogeneousRayBundle, ray_bundle_to_ray_points, RayBundle, TexturesAtlas, TexturesVertex
  from pytorch3d.renderer.camera_utils import camera_to_eye_at_up
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.structures import join_meshes_as_scene, Meshes, Pointclouds
label_desc: Use image node_id 8 for calling a global function with example usage: _add_mesh_trace(fig, meshes, trace_name, subplot_idx, ncols, lighting) without return types