code: def _reduce_search_space(
      self, model_centroids, reduction_thr=20, reduction_distance="mdf"
  ):
      if self.verbose:
          t = time()
          logger.info("# Reduce search space")
          logger.info(f" Reduction threshold {reduction_thr:0.3f}")
          logger.info(f" Reduction distance {reduction_distance}")
  
      if reduction_distance.lower() == "mdf":
          if self.verbose:
              logger.info(" Using MDF")
          centroid_matrix = bundles_distances_mdf(
              model_centroids, self.centroids
          )
      elif reduction_distance.lower() == "mam":
          if self.verbose:
              logger.info(" Using MAM")
          centroid_matrix = bundles_distances_mam(
              model_centroids, self.centroids
          )
      else:
          raise ValueError("Given reduction distance not known")
  
      centroid_matrix[centroid_matrix > reduction_thr] = np.inf
  
      mins = np.min(centroid_matrix, axis=0)
      close_clusters_indices = list(np.where(mins != np.inf)[0])
  
      close_clusters = self.cluster_map[close_clusters_indices]
  
      neighb_indices = [cluster.indices for cluster in close_clusters]
  
      neighb_streamlines = Streamlines(chain(*close_clusters))
  
      nb_neighb_streamlines = len(neighb_streamlines)
  
      if nb_neighb_streamlines == 0:
          if self.verbose:
              logger.info(
                  "You have no neighbor streamlines... "
                  + "No bundle recognition"
              )
          return Streamlines([]), []
      if self.verbose:
          logger.info(
              f" Number of neighbor streamlines"
              f" {nb_neighb_streamlines}"
          )
          logger.info(f" Duration {time() - t:0.3f} s\n")
  
      return neighb_streamlines, neighb_indices
  
imports: from time import time
  from itertools import chain
  import logging
  import numpy
  from dipy.tracking.streamline import set_number_of_points, nbytes, select_random_set_of_streamlines
  from dipy.segment.clustering import qbx_and_merge
  from dipy.tracking.distances import bundles_distances_mdf, bundles_distances_mam
  from dipy.align.streamlinear import StreamlineLinearRegistration, BundleMinDistanceMetric, BundleSumDistanceMatrixMetric, BundleMinDistanceAsymmetricMetric
  from dipy.tracking.streamline import Streamlines, length
  from dipy.utils.deprecator import deprecated_params
  from nibabel.affines import apply_affine
label_desc: Use image node_id 7 for calling the RecoBundles obj's underlying member method code with example usage: obj._reduce_search_space(model_centroids, reduction_thr, reduction_distance) and returns: neighb_streamlines,  neighb_indices, Streamlines,  list