code: def __test_time(jam_orig, jam_new, rate):
      # Test the track length
      ap_(
          librosa.get_duration(**jam_orig.sandbox.muda["_audio"]),
          rate * librosa.get_duration(**jam_new.sandbox.muda["_audio"]),
      )
  
      # Test the metadata
      ap_(
          jam_orig.file_metadata.duration,
          rate * jam_new.file_metadata.duration,
      )
  
      # Test each annotation
      for ann_orig, ann_new in zip(
          jam_orig.annotations, jam_new.annotations
      ):
          # JAMS 0.2.1 support
          if hasattr(ann_orig, "time"):
              ap_(ann_orig.time, rate * ann_new.time)
              ap_(ann_orig.duration, rate * ann_new.duration)
  
          assert len(ann_orig.data) == len(ann_new.data)
  
          for obs1, obs2 in zip(ann_orig, ann_new):
              ap_(obs1.time, rate * obs2.time)
              ap_(obs1.duration, rate * obs2.duration)
  
              if ann_orig.namespace == "tempo":
                  ap_(rate * obs1.value, obs2.value)
  
imports: from copy import deepcopy
  import re
  import six
  import numpy
  import soundfile
  import jams
  import librosa
  import muda
  import pytest
  import scipy
  from contextlib import contextmanager
label_desc: Use image node_id 6 for calling a global function with example usage: __test_time(jam_orig, jam_new, rate) without return types