code: def test_length_memory_leaks(rng):
      # Test some dtypes
      dtypes = [np.float32, np.float64, np.int32, np.int64]
      for dtype in dtypes:
          s_rng = np.random.default_rng(1234)
          NB_STREAMLINES = 10000
          streamlines = [
              s_rng.standard_normal(
                  (s_rng.integers(10, 100), 3)
              ).astype(dtype)
              for _ in range(NB_STREAMLINES)
          ]
  
          list_refcount_before = get_type_refcount()["list"]
  
          # lengths = length(streamlines)
          list_refcount_after = get_type_refcount()["list"]
  
          # Calling `length` shouldn't increase the refcount of `list`
          # since the return value is a numpy array.
          assert_equal(list_refcount_after, list_refcount_before)
  
      # Test mixed dtypes
      NB_STREAMLINES = 10000
      streamlines = []
      for i in range(NB_STREAMLINES):
          dtype = dtypes[i % len(dtypes)]
          streamlines.append(
              rng.standard_normal((rng.integers(10, 100), 3)).astype(
                  dtype
              )
          )
  
      list_refcount_before = get_type_refcount()["list"]
  
      # lengths = length(streamlines)
      list_refcount_after = get_type_refcount()["list"]
  
      # Calling `length` shouldn't increase the refcount of `list`
      # since the return value is a numpy array.
      assert_equal(list_refcount_after, list_refcount_before)
  
imports: import warnings
  import types
  import numpy
  from numpy.linalg import norm
  import numpy.testing
  from dipy.testing.memory import get_type_refcount
  from dipy.testing import assert_arrays_equal
  from dipy.testing.decorators import set_random_number_generator
  from dipy.testing import assert_true
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_almost_equal, assert_equal
  from dipy.tracking.streamlinespeed import compress_streamlines, length, set_number_of_points
  from dipy.tracking.streamline import Streamlines
  from dipy.tracking.streamline import relist_streamlines, unlist_streamlines, center_streamlines, transform_streamlines, select_random_set_of_streamlines, select_by_rois, orient_by_rois, orient_by_streamline, values_from_volume, deform_streamlines, cluster_confidence
label_desc: Use image node_id 6 for calling a global function with example usage: test_length_memory_leaks(rng) without return types