code: def test_merge_samples_and_labels_video():
      dataset = foz.load_zoo_dataset("quickstart-video").limit(3)
  
      dataset1 = dataset[:2].clone()
  
      dataset2 = dataset[1:].clone()
      dataset2.set_field(
          "frames.detections.detections.label",
          (F("label") == "vehicle").if_else(
              F("label").upper(), F("label")
          ),
      ).save()
  
      d1 = dataset1.clone()
      d1.merge_samples(dataset2)
  
      num_objects1 = d1.count("frames.detections.detections")
      num_objects1_ref = dataset.count("frames.detections.detections")
      assert num_objects1 == num_objects1_ref
  
      counts1 = d1.count_values("frames.detections.detections.label")
      counts1_ref1 = dataset1[:1].count_values(
          "frames.detections.detections.label"
      )
      counts1_ref2 = dataset2.count_values(
          "frames.detections.detections.label"
      )
      assert counts1["vehicle"] == counts1_ref1["vehicle"]
      assert counts1["VEHICLE"] == counts1_ref2["VEHICLE"]
  
      d2 = dataset1.clone()
      d2.merge_samples(dataset2, overwrite=False)
  
      num_objects2 = d2.count("frames.detections.detections")
      num_objects2_ref = dataset.count("frames.detections.detections")
      assert num_objects2 == num_objects2_ref
  
      counts2 = d2.count_values("frames.detections.detections.label")
      counts2_ref1 = dataset1.count_values(
          "frames.detections.detections.label"
      )
      counts2_ref2 = dataset2[1:].count_values(
          "frames.detections.detections.label"
      )
      assert counts2["vehicle"] == counts2_ref1["vehicle"]
      assert counts2["VEHICLE"] == counts2_ref2["VEHICLE"]
  
file_path: fiftyone/tests/intensive/merge_tests.py
imports: import os
  import pytest
  import eta.core.utils
  import fiftyone
  import fiftyone.zoo
  from fiftyone import ViewField
label_desc: Use image node_id 5 for calling a global function with example usage: test_merge_samples_and_labels_video() without return types