code: def cameras_for_ids(
      cameras: PinholeCamera, camera_ids: Union[List[int], Tensor]
  ) -> PinholeCamera:
      r"""Takes a PinholeCamera camera object and a set of camera indices and creates a new PinholeCamera object for
      the requested cameras.
  
      Args:
          cameras: Scene camera object: PinholeCamera
          camera_ids: List of camera indices to copy: List[int]
  
      Return:
          A new PinholeCamera object with a sub-set of cameras: PinholeCamera
      """
      intrinsics = cameras.intrinsics[camera_ids]
      extrinsics = cameras.extrinsics[camera_ids]
      height = cameras.height[camera_ids]
      width = cameras.width[camera_ids]
      return PinholeCamera(intrinsics, extrinsics, height, width)
  
file_path: kornia/kornia/nerf/camera_utils.py
imports: import math
  from typing import List, Tuple, Union
  import torch
  from kornia.core import Device, Tensor, cos, sin, stack
  from kornia.geometry.camera import PinholeCamera
  from kornia.geometry.conversions import quaternion_to_rotation_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: cameras_for_ids(cameras, camera_ids) and returns: PinholeCamera