code: def _sample_one_view_naive(
      camera,
      pts,
      feats,
      masks,
      masked_sampling,
      sampling_mode="bilinear",
  ):
      """
      Sample a single source view.
      """
      proj_ndc = camera.transform_points(pts[None])[
          None, ..., :-1
      ]  # 1 x 1 x n_pts x 2
      feats_sampled = {
          k: pt3d.renderer.ndc_grid_sample(
              f[None], proj_ndc, mode=sampling_mode
          ).permute(0, 3, 1, 2)[0, :, :, 0]
          for k, f in feats.items()
      }  # n_pts x dim
      if not masked_sampling:
          n_pts = pts.shape[0]
          masks_sampled = proj_ndc.new_ones(n_pts, 1)
      else:
          masks_sampled = pt3d.renderer.ndc_grid_sample(
              masks[None],
              proj_ndc,
              mode=sampling_mode,
              align_corners=False,
          )[0, 0, 0, :][:, None]
      return feats_sampled, masks_sampled
  
file_path: pytorch3d/tests/implicitron/test_viewsampling.py
imports: import unittest
  import pytorch3d
  import torch
  from pytorch3d.implicitron.models.view_pooler.view_sampler import ViewSampler
  from pytorch3d.implicitron.tools.config import expand_args_fields
label_desc: Use image node_id 2 for calling a global function with example usage: _sample_one_view_naive(camera, pts, feats, masks, masked_sampling, sampling_mode) and returns: feats_sampled,  masks_sampled