code: def test_upload(self):
      # Test images
      dataset = foz.load_zoo_dataset(
          "quickstart", max_samples=1
      ).clone()
  
      prev_ids = dataset.values(
          "ground_truth.detections.id", unwind=True
      )
  
      anno_key = "anno_key"
      results = dataset.annotate(
          anno_key,
          backend="cvat",
          label_field="ground_truth",
      )
      with results:
          api = results.connect_to_api()
          task_id = results.task_ids[0]
          shape_id = dataset.first().ground_truth.detections[0].id
          self.assertIsNotNone(_get_shape(api, task_id, shape_id))
  
          sample_id = list(
              list(results.frame_id_map.values())[0].values()
          )[0]["sample_id"]
          self.assertEqual(sample_id, dataset.first().id)
  
      dataset.reload()
      dataset.load_annotations(anno_key, cleanup=True)
  
      self.assertListEqual(
          prev_ids,
          dataset.values("ground_truth.detections.id", unwind=True),
      )
  
      # Test Videos
      dataset = foz.load_zoo_dataset(
          "quickstart-video", max_samples=1
      ).clone()
  
      prev_ids = dataset.values(
          "frames.detections.detections.id", unwind=True
      )
  
      anno_key = "anno_key"
      results = dataset.annotate(
          anno_key,
          backend="cvat",
          label_field="frames.detections",
      )
      with results:
          api = results.connect_to_api()
          task_id = results.task_ids[0]
          shape_id = (
              dataset.first().frames[1].detections.detections[0].id
          )
          self.assertIsNotNone(_get_shape(api, task_id, shape_id))
  
          sample_id = list(
              list(results.frame_id_map.values())[0].values()
          )[0]["sample_id"]
          self.assertEqual(sample_id, dataset.first().id)
  
      dataset.reload()
      dataset.load_annotations(anno_key, cleanup=True)
  
      self.assertListEqual(
          prev_ids,
          dataset.values(
              "frames.detections.detections.id", unwind=True
          ),
      )
  
imports: from bson import ObjectId
  from collections import defaultdict
  import numpy
  import os
  import unittest
  import eta.core.utils
  import fiftyone
  import fiftyone.utils.cvat
  import fiftyone.zoo
  from fiftyone.core.expressions import ViewField
label_desc: Use image node_id 1 for calling the CVATTests obj's underlying member method code with example usage: obj.test_upload() without return types