code: def test_extended_frame_sample(self):
      dataset = fod.Dataset("test")
      sample = fos.Sample(
          filepath="video.mp4",
      )
      sample.frames[1] = fo.Frame(
          predictions=fol.Detections(
              detections=[
                  fol.Detection(
                      label="carrot",
                      confidence=0.25,
                      tags=["one", "two"],
                  ),
                  fol.Detection(
                      label="not_carrot", confidence=0.75, tags=["two"]
                  ),
              ]
          )
      )
      dataset.add_sample(sample)
  
      filters = {
          "frames.predictions.detections.label": {
              "values": ["carrot"],
              "exclude": False,
              "isMatching": False,
          },
          "frames.predictions.detections.confidence": {
              "range": [0.5, 1],
              "exclude": False,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "frames.predictions.detections.label": {
              "values": ["carrot"],
              "exclude": False,
              "isMatching": False,
          },
          "frames.predictions.detections.confidence": {
              "range": [0.0, 0.5],
              "exclude": False,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(
          len(view.first().frames[1].predictions.detections), 1
      )
  
      view = fosv.get_view("test", pagination_data=True)
      (sample,) = list(
          foo.aggregate(
              foo.get_db_conn()[view._dataset._sample_collection_name],
              view._pipeline(),
          )
      )
      self.assertIn("_label_tags", sample)
      self.assertDictEqual(sample["_label_tags"], {"one": 1, "two": 2})
  
      filters = {
          "_label_tags": {
              "values": ["two"],
              "exclude": False,
              "isMatching": True,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(
          len(view.first().frames[1].predictions.detections), 2
      )
  
      filters = {
          "_label_tags": {
              "values": ["one"],
              "exclude": False,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(
          len(view.first().frames[1].predictions.detections), 1
      )
  
      view = fosv.get_view(
          "test", pagination_data=True, filters=filters
      )
      (sample,) = list(
          foo.aggregate(
              foo.get_db_conn()[view._dataset._sample_collection_name],
              view._pipeline(),
          )
      )
      self.assertIn("_label_tags", sample)
      self.assertDictEqual(sample["_label_tags"], {"one": 1, "two": 1})
  
      filters = {
          "_label_tags": {
              "values": ["two"],
              "exclude": True,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(
          len(view.first().frames[1].predictions.detections), 0
      )
  
      filters = {
          "_label_tags": {
              "values": ["one"],
              "exclude": True,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(
          view.first().frames[1].predictions.detections[0].label,
          "not_carrot",
      )
  
      view = fosv.get_view(
          "test", pagination_data=True, filters=filters
      )
      (sample,) = list(
          foo.aggregate(
              foo.get_db_conn()[view._dataset._sample_collection_name],
              view._pipeline(),
          )
      )
      self.assertIn("_label_tags", sample)
      self.assertDictEqual(sample["_label_tags"], {"two": 1})
  
      filters = {
          "_label_tags": {
              "values": ["one"],
              "exclude": True,
              "isMatching": True,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
imports: import math
  import unittest
  import fiftyone
  import fiftyone.core.dataset
  import fiftyone.core.labels
  import fiftyone.core.odm
  import fiftyone.core.sample
  from fiftyone.server.query import Dataset
  from fiftyone.server.samples import paginate_samples
  import fiftyone.server.view
  from decorators import drop_datasets
  from utils.groups import make_disjoint_groups_dataset
label_desc: Use image node_id 2 for calling the ServerViewTests obj's underlying member method code with example usage: obj.test_extended_frame_sample() without return types