code: def test_expand_schema(self):
      # None-valued new frame fields are ignored for schema expansion
  
      dataset = fo.Dataset()
  
      sample = fo.Sample(filepath="video.mp4")
      sample.frames[1] = fo.Frame(ground_truth=None)
      dataset.add_sample(sample)
  
      self.assertNotIn("ground_truth", dataset.get_frame_field_schema())
  
      # None-valued new frame fields are allowed when a later frame
      # determines the appropriate field type
  
      dataset = fo.Dataset()
  
      sample = fo.Sample(filepath="video.mp4")
      sample.frames[1] = fo.Frame(ground_truth=None)
      sample.frames[2] = fo.Frame(ground_truth=fo.Classification())
  
      dataset.add_sample(sample)
  
      self.assertIn("ground_truth", dataset.get_frame_field_schema())
  
      # Test implied frame field types
  
      dataset = fo.Dataset()
  
      sample = fo.Sample(filepath="video.mp4")
      sample.frames[1] = fo.Frame(
          bool_field=True,
          int_field=1,
          str_field="hi",
          float_field=1.0,
          date_field=date.today(),
          datetime_field=datetime.utcnow(),
          list_field=[1, 2, 3],
          dict_field={"hello": "world"},
          vector_field=np.arange(5),
          array_field=np.random.randn(3, 4),
      )
  
      dataset.add_sample(sample)
      schema = dataset.get_frame_field_schema()
  
      self.assertIsInstance(schema["bool_field"], fo.BooleanField)
      self.assertIsInstance(schema["int_field"], fo.IntField)
      self.assertIsInstance(schema["str_field"], fo.StringField)
      self.assertIsInstance(schema["float_field"], fo.FloatField)
      self.assertIsInstance(schema["date_field"], fo.DateField)
      self.assertIsInstance(schema["datetime_field"], fo.DateTimeField)
      self.assertIsInstance(schema["list_field"], fo.ListField)
      self.assertIsInstance(schema["dict_field"], fo.DictField)
      self.assertIsInstance(schema["vector_field"], fo.VectorField)
      self.assertIsInstance(schema["array_field"], fo.ArrayField)
  
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 5 for calling the VideoTests obj's underlying member method code with example usage: obj.test_expand_schema() without return types