code: def _add_camera_trace(
      fig: go.Figure,
      cameras: CamerasBase,
      trace_name: str,
      subplot_idx: int,
      ncols: int,
      camera_scale: float,
  ) -> None:  # pragma: no cover
      """
      Adds a trace rendering a Cameras object to the passed in figure, with
      a given name and in a specific subplot.
  
      Args:
          fig: plotly figure to add the trace within.
          cameras: the Cameras 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.
          camera_scale: the size of the wireframe used to render the Cameras object.
      """
      cam_wires = get_camera_wireframe(camera_scale).to(cameras.device)
      cam_trans = cameras.get_world_to_view_transform().inverse()
      cam_wires_trans = (
          cam_trans.transform_points(cam_wires).detach().cpu()
      )
      # if batch size is 1, unsqueeze to add dimension
      if len(cam_wires_trans.shape) < 3:
          cam_wires_trans = cam_wires_trans.unsqueeze(0)
  
      nan_tensor = torch.Tensor([[float("NaN")] * 3])
      all_cam_wires = cam_wires_trans[0]
      for wire in cam_wires_trans[1:]:
          # We combine camera points into a single tensor to plot them in a
          # single trace. The NaNs are inserted between sets of camera
          # points so that the lines drawn by Plotly are not drawn between
          # points that belong to different cameras.
          all_cam_wires = torch.cat((all_cam_wires, nan_tensor, wire))
      x, y, z = all_cam_wires.detach().cpu().numpy().T.astype(float)
  
      row, col = subplot_idx // ncols + 1, subplot_idx % ncols + 1
      fig.add_trace(
          go.Scatter3d(
              x=x, y=y, z=z, marker={"size": 1}, 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]
  
      # flatten for bounds calculations
      flattened_wires = cam_wires_trans.flatten(0, 1)
      verts_center = flattened_wires.mean(0)
      max_expand = (
          flattened_wires.max(0)[0] - flattened_wires.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 10 for calling a global function with example usage: _add_camera_trace(fig, cameras, trace_name, subplot_idx, ncols, camera_scale) without return types