code: def test_with_simulated_bundles2():
      # Generate synthetic streamlines
      bundles = bearing_bundles(4, 2)
      bundles.append(straight_bundle(1))
      streamlines = list(itertools.chain(*bundles))
  
      thresholds = [10, 2, 1]
      qbx_class = QuickBundlesX(thresholds)
      tree = qbx_class.cluster(streamlines)
      # By default `refdata` refers to data being clustered.
      assert_equal(tree.refdata, streamlines)
  
imports: import itertools
  import numpy
  from numpy.testing import assert_array_equal, assert_equal, assert_raises
  from dipy.segment.clustering import QuickBundlesX, QuickBundles, qbx_and_merge
  from dipy.segment.featurespeed import ResampleFeature
  from dipy.segment.metricspeed import AveragePointwiseEuclideanMetric, MinimumAverageDirectFlipMetric
  from dipy.tracking.streamline import set_number_of_points
  from dipy.tracking.streamline import Streamlines
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 9 for calling a global function with example usage: test_with_simulated_bundles2() without return types