code: def test_video_sample(self):
      sample = fo.Sample(filepath="video.mp4")
      frames = sample.frames
  
      self.assertEqual(len(frames), 0)
      self.assertFalse(1 in frames, False)
  
      frame1 = fo.Frame(frame_number=1)
      frame5 = fo.Frame()
      frame3 = fo.Frame(hello="world")
  
      self.assertIsNone(frame1.sample_id)
      self.assertIsNone(frame1._sample_id)
  
      # Intentionally out of order to test sorting
      frames[1] = frame1
      frames[5] = frame5
      frames[3] = frame3
  
      self.assertEqual(len(frames), 3)
      self.assertTrue(1 in frames)
      self.assertFalse(2 in frames)
      self.assertTrue(3 in frames)
      self.assertFalse(4 in frames)
      self.assertTrue(5 in frames)
  
      self.assertTrue(list(frames.keys()), [1, 3, 5])
  
      frame_numbers = []
      for frame_number, frame in frames.items():
          frame_numbers.append(frame_number)
          self.assertEqual(frame_number, frame.frame_number)
  
      self.assertTrue(frame_numbers, [1, 3, 5])
  
      del frames[3]
  
      self.assertFalse(3 in frames)
      self.assertTrue(list(frames.keys()), [1, 5])
  
      frame_numbers = []
      for frame_number, frame in frames.items():
          frame_numbers.append(frame_number)
          self.assertEqual(frame_number, frame.frame_number)
  
      self.assertTrue(frame_numbers, [1, 5])
  
      dataset = fo.Dataset()
      dataset.add_sample(sample)
  
      self.assertIsNotNone(sample.id)
      self.assertIsNotNone(frame1.id)
      self.assertIsNone(frame3.id)
      self.assertIsNotNone(frame5.id)
  
      self.assertIsInstance(frame1.sample_id, str)
      self.assertIsInstance(frame1._sample_id, ObjectId)
  
      self.assertTrue(len(sample.frames), 2)
  
      self.assertTrue(1 in sample.frames)
      self.assertFalse(2 in sample.frames)
      self.assertFalse(3 in sample.frames)
      self.assertFalse(4 in sample.frames)
      self.assertTrue(5 in sample.frames)
  
      frame_numbers = []
      for frame_number, frame in sample.frames.items():
          frame_numbers.append(frame_number)
          self.assertEqual(frame_number, frame.frame_number)
  
      self.assertTrue(frame_numbers, [1, 5])
  
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 1 for calling the VideoTests obj's underlying member method code with example usage: obj.test_video_sample() without return types