code: def sample_orbit(
      size: int,
      radius: torch.Tensor,
      theta_range: np.ndarray,
      phi_range: np.ndarray,
      device: torch.device = "cuda",
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      """
      Sample points on a spherical orbit.
  
      Args:
          size (int): Number of points to sample.
          radius (torch.Tensor): Radii for the points.
          theta_range (np.ndarray): Elevation angle range in radians [min, max].
          phi_range (np.ndarray): Azimuth angle range in radians [min, max].
          device (torch.device): Device to allocate tensors on.
  
      Returns:
          Tuple: Contains the following:
              - centers (torch.Tensor): The Cartesian coordinates of the sampled points.
              - thetas (torch.Tensor): Elevation angles in radians.
              - phis (torch.Tensor): Azimuth angles in radians.
      """
      thetas = (
          torch.rand(size, device=device)
          * (theta_range[1] - theta_range[0])
          + theta_range[0]
      )
      phis = (
          torch.rand(size, device=device)
          * (phi_range[1] - phi_range[0])
          + phi_range[0]
      )
      phis[phis < 0] += 2 * np.pi
  
      x = radius * torch.sin(thetas) * torch.sin(phis)
      y = radius * torch.cos(thetas)
      z = radius * torch.sin(thetas) * torch.cos(phis)
  
      centers = torch.stack([x, y, z], dim=-1)
  
      return centers, thetas, phis
  
file_path: NeMo/nemo/collections/multimodal/data/nerf/random_poses.py
imports: import random
  from typing import Any, Dict, Iterator, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn.functional
  from torch.utils.data import IterableDataset
  from nemo.collections.multimodal.data.nerf.cameras import PinholeCamera
  from nemo.collections.multimodal.data.nerf.utils import compute_look_at_vectors, construct_poses, get_rays, get_view_direction
label_desc: Use image node_id 4 for calling a global function with example usage: sample_orbit(size, radius, theta_range, phi_range, device) and returns: centers,  thetas,  phis