code: def test_extended_dynamic_image_sample(self):
      dataset = fod.Dataset("test")
      sample = fos.Sample(
          filepath="image.png",
          dynamic=fo.DynamicEmbeddedDocument(
              predictions=fol.Detections(
                  detections=[
                      fol.Detection(
                          label="carrot",
                          confidence=0.25,
                          tags=["one", "two"],
                      ),
                      fol.Detection(
                          label="not_carrot",
                          confidence=0.75,
                          tags=["two"],
                      ),
                  ]
              ),
              bool=True,
              int=1,
              str="str",
              list_bool=[True],
              list_int=[1, 2],
              list_str=["one", "two"],
          ),
          dynamic_list=[
              fo.DynamicEmbeddedDocument(
                  bool=True,
                  int=1,
                  str="str",
                  list_bool=[True],
                  list_int=[1, 2],
                  list_str=["one", "two"],
              )
          ],
      )
      dataset.add_sample(sample)
      dataset.add_dynamic_sample_fields()
  
      filters = {
          "dynamic.predictions.detections.label": {
              "values": ["carrot"],
              "exclude": False,
              "isMatching": False,
          },
          "dynamic.predictions.detections.confidence": {
              "range": [0.5, 1],
              "exclude": False,
              "isMatching": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic.predictions.detections.label": {
              "values": ["carrot"],
              "exclude": False,
              "isMatching": False,
          },
          "dynamic.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().dynamic.predictions.detections), 1
      )
  
      filters = {
          "dynamic.list_str": {
              "values": ["one"],
              "exclude": False,
          },
          "dynamic.list_int": {
              "range": [0, 2],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
      self.assertEqual(len(view.first().dynamic.list_str), 2)
      self.assertEqual(len(view.first().dynamic.list_int), 2)
  
      filters = {
          "dynamic.list_str": {
              "values": ["empty"],
              "exclude": False,
          },
          "dynamic.list_int": {
              "range": [0, 2],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic.list_str": {
              "values": ["one"],
              "exclude": False,
          },
          "dynamic.list_int": {
              "range": [3, 4],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic.list_bool": {
              "true": False,
              "false": True,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic.list_bool": {
              "true": False,
              "false": True,
              "exclude": True,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
  
      filters = {
          "dynamic.list_bool": {
              "true": True,
              "false": False,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 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().dynamic.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().dynamic.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().dynamic.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().dynamic.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)
  
      filters = {
          "dynamic_list.bool": {
              "true": False,
              "false": True,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic_list.list_bool": {
              "true": False,
              "false": True,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic_list.bool": {
              "true": True,
              "false": False,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
  
      filters = {
          "dynamic_list.list_bool": {
              "true": True,
              "false": False,
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
  
      filters = {
          "dynamic_list.int": {
              "range": [-1, 0],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic_list.list_int": {
              "range": [-1, 0],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic_list.int": {
              "range": [0, 1],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
  
      filters = {
          "dynamic_list.list_int": {
              "range": [0, 1],
              "exclude": False,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 1)
  
      filters = {
          "dynamic_list.int": {
              "range": [0, 2],
              "exclude": True,
          },
      }
      view = fosv.get_view("test", filters=filters)
      self.assertEqual(len(view), 0)
  
      filters = {
          "dynamic_list.list_int": {
              "range": [0, 2],
              "exclude": 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 3 for calling the ServerViewTests obj's underlying member method code with example usage: obj.test_extended_dynamic_image_sample() without return types