code: def _add_pointcloud_trace(
      fig: go.Figure,
      pointclouds: Pointclouds,
      trace_name: str,
      subplot_idx: int,
      ncols: int,
      max_points_per_pointcloud: int,
      marker_size: int,
  ) -> None:  # pragma: no cover
      """
      Adds a trace rendering a Pointclouds object to the passed in figure, with
      a given name and in a specific subplot.
  
      Args:
          fig: plotly figure to add the trace within.
          pointclouds: Pointclouds 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.
          max_points_per_pointcloud: the number of points to render, which are randomly sampled.
          marker_size: the size of the rendered points
      """
      pointclouds = (
          pointclouds.detach()
          .cpu()
          .subsample(max_points_per_pointcloud)
      )
      verts = pointclouds.points_packed()
      features = pointclouds.features_packed()
  
      color = None
      if features is not None:
          if features.shape[1] == 4:  # rgba
              template = "rgb(%d, %d, %d, %f)"
              rgb = (features[:, :3].clamp(0.0, 1.0) * 255).int()
              color = [
                  template % (*rgb_, a_)
                  for rgb_, a_ in zip(rgb, features[:, 3])
              ]
  
          if features.shape[1] == 3:
              template = "rgb(%d, %d, %d)"
              rgb = (features.clamp(0.0, 1.0) * 255).int()
              color = [template % (r, g, b) for r, g, b in rgb]
  
      row = subplot_idx // ncols + 1
      col = subplot_idx % ncols + 1
      fig.add_trace(
          go.Scatter3d(
              x=verts[:, 0],
              y=verts[:, 1],
              z=verts[:, 2],
              marker={"color": color, "size": marker_size},
              mode="markers",
              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
      verts_center = verts.mean(0)
      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 9 for calling a global function with example usage: _add_pointcloud_trace(fig, pointclouds, trace_name, subplot_idx, ncols, max_points_per_pointcloud, marker_size) without return types