code: def test_add_collection(self):
      sample1 = fo.Sample(filepath="video.mp4", foo="bar")
      sample1.frames[1] = fo.Frame(foo="bar")
      dataset1 = fo.Dataset()
      dataset1.add_sample(sample1)
  
      sample2 = fo.Sample(filepath="video.mp4", spam="eggs")
      sample2.frames[1] = fo.Frame(spam="eggs")
      dataset2 = fo.Dataset()
      dataset2.add_sample(sample2)
  
      # Merge dataset
      dataset = dataset1.clone()
      dataset.add_collection(dataset2)
  
      self.assertEqual(len(dataset), 2)
      self.assertEqual(dataset.count("frames"), 2)
      self.assertTrue("spam" in dataset.get_field_schema())
      self.assertTrue("spam" in dataset.get_frame_field_schema())
      self.assertIsNone(dataset.first()["spam"])
      self.assertIsNone(dataset.first().frames.first()["spam"])
      self.assertEqual(dataset.last()["spam"], "eggs")
      self.assertEqual(dataset.last().frames.last()["spam"], "eggs")
  
      # Merge view
      dataset = dataset1.clone()
      dataset.add_collection(
          dataset2.exclude_fields(["spam", "frames.spam"])
      )
  
      self.assertEqual(len(dataset), 2)
      self.assertEqual(dataset.count("frames"), 2)
      self.assertTrue("spam" not in dataset.get_field_schema())
      self.assertTrue("spam" not in dataset.get_frame_field_schema())
      self.assertIsNone(dataset.last()["foo"])
      self.assertIsNone(dataset.last().frames.last()["foo"])
  
imports: from copy import deepcopy
  from datetime import date, datetime
  from bson import ObjectId
  import numpy
  import unittest
  import fiftyone
  import fiftyone.core.odm
  from fiftyone import ViewField
  from decorators import drop_datasets
label_desc: Use image node_id 22 for calling the VideoTests obj's underlying member method code with example usage: obj.test_add_collection() without return types