code: def test_video_sample_view(self):
      dataset = fo.Dataset()
  
      sample = fo.Sample(filepath="video.mp4")
  
      frame1 = fo.Frame(frame_number=1)
      frame3 = fo.Frame(hello="world")
      frame5 = fo.Frame()
  
      sample.frames[1] = frame1
      sample.frames[3] = frame3
      sample.frames[5] = frame5
  
      dataset.add_sample(sample)
  
      view = dataset.view()
  
      sample_view = view.first()
  
      frame_view1 = sample_view.frames[1]
      frame_view3 = sample_view.frames[3]
      frame_view5 = sample_view.frames[5]
  
      self.assertEqual(len(sample_view.frames), 3)
      self.assertEqual(frame_view1.id, frame1.id)
      self.assertEqual(frame_view3.id, frame3.id)
      self.assertEqual(frame_view5.id, frame5.id)
  
      sample_view.frames[2] = fo.Frame(foo="bar")
  
      self.assertEqual(len(sample_view.frames), 4)
      self.assertListEqual(
          list(sample_view.frames.keys()), [1, 2, 3, 5]
      )
  
      self.assertTrue(dataset.has_frame_field("foo"))
      self.assertEqual(len(sample.frames), 3)
      self.assertListEqual(list(sample.frames.keys()), [1, 3, 5])
  
      sample_view.save()
  
      self.assertEqual(len(sample.frames), 4)
      self.assertListEqual(list(sample.frames.keys()), [1, 2, 3, 5])
  
      sample_view.frames[1]["hello"] = "goodbye"
      sample_view.frames[3]["hello"] = "goodbye"
      sample_view.save()
  
      self.assertEqual(sample_view.frames[1]["hello"], "goodbye")
      self.assertEqual(sample_view.frames[3]["hello"], "goodbye")
      self.assertEqual(sample_view.frames[5]["hello"], None)
  
      self.assertEqual(frame1.hello, "goodbye")
      self.assertEqual(frame3.hello, "goodbye")
      self.assertEqual(frame5.hello, None)
  
      frame1.hello = "there"
      frame3.hello = "there"
  
      sample.save()
  
      self.assertEqual(sample.frames[1].hello, "there")
      self.assertEqual(sample.frames[3].hello, "there")
  
      # sample view objects are not singletones
      self.assertEqual(sample_view.frames[1].hello, "goodbye")
      self.assertEqual(sample_view.frames[3].hello, "goodbye")
  
      # but reloading from the view does work
      self.assertEqual(view.first().frames[1].hello, "there")
      self.assertEqual(view.first().frames[3].hello, "there")
  
      del sample_view.frames[2]
      del sample_view.frames[3]
  
      self.assertEqual(len(sample_view.frames), 2)
      self.assertEqual(list(sample_view.frames.keys()), [1, 5])
  
      frame_numbers = []
      for frame_number, frame in sample_view.frames.items():
          frame_numbers.append(frame_number)
          self.assertEqual(frame_number, frame.frame_number)
  
      self.assertListEqual(frame_numbers, [1, 5])
  
      self.assertEqual(len(sample.frames), 4)
      self.assertEqual(list(sample.frames.keys()), [1, 2, 3, 5])
  
      sample_view.save()
  
      self.assertEqual(len(sample.frames), 2)
      self.assertEqual(list(sample.frames.keys()), [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 13 for calling the VideoTests obj's underlying member method code with example usage: obj.test_video_sample_view() without return types