code: def test_quickbundles_memory_leaks():
      qb = QuickBundles(threshold=2 * threshold)
  
      type_name_pattern = "memoryview"
      initial_types_refcount = get_type_refcount(type_name_pattern)
  
      qb.cluster(data)
      # At this point, all memoryviews created during clustering should be freed.
      assert_equal(
          get_type_refcount(type_name_pattern), initial_types_refcount
      )
  
file_path: dipy/dipy/segment/tests/test_quickbundles.py
imports: import numpy
  import itertools
  from numpy.testing import assert_array_equal, assert_equal, assert_raises
  from dipy.testing.memory import get_type_refcount
  from dipy.testing import assert_arrays_equal
  from dipy.segment.clustering import QuickBundles
  import dipy.segment.featurespeed
  import dipy.segment.metricspeed
  from dipy.segment.clustering_algorithms import quickbundles
  import dipy.tracking.streamline
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 8 for calling a global function with example usage: test_quickbundles_memory_leaks() without return types