code: def orient_by_streamline(
      streamlines,
      standard,
      n_points=12,
      in_place=False,
      as_generator=False,
  ):
      """
      Orient a bundle of streamlines to a standard streamline.
  
      Parameters
      ----------
      streamlines : Streamlines, list
          The input streamlines to orient.
      standard : Streamlines, list, or ndarrray
          This provides the standard orientation according to which the
          streamlines in the provided bundle should be reoriented.
      n_points: int, optional
          The number of samples to apply to each of the streamlines.
      in_place : bool
          Whether to make the change in-place in the original input
          (and return a reference), or to make a copy of the list
          and return this copy, with the relevant streamlines reoriented.
          Default: False.
      as_generator : bool
          Whether to return a generator as output. Default: False
  
      Returns
      -------
      Streamlines : with each individual array oriented to be as similar as
          possible to the standard.
  
      """
      # Start by resampling, so that distance calculation is easy:
      fgarray = set_number_of_points(streamlines, n_points)
      std_array = set_number_of_points([standard], n_points)
  
      if as_generator:
          if in_place:
              w_s = "Cannot return a generator when in_place is set to True"
              raise ValueError(w_s)
          return _orient_by_sl_generator(
              streamlines, std_array, fgarray
          )
  
      # If it's a generator on input, we may as well generate it
      # here and now:
      if isinstance(streamlines, types.GeneratorType):
          out = Streamlines(streamlines)
  
      elif in_place:
          out = streamlines
      else:
          # Make a copy, so you don't change the output in place:
          out = deepcopy(streamlines)
  
      return _orient_by_sl_list(out, std_array, fgarray)
  
imports: from copy import deepcopy
  from warnings import warn
  import types
  from scipy.spatial.distance import cdist
  import numpy
  from nibabel.affines import apply_affine
  from nibabel.streamlines import ArraySequence
  from dipy.tracking.streamlinespeed import length, set_number_of_points
  from dipy.tracking.distances import bundles_distances_mdf
  import dipy.tracking.utils
  from dipy.core.geometry import dist_to_corner
  from dipy.core.interpolation import interpolate_vector_3d, interpolate_scalar_3d
label_desc: Use image node_id 14 for calling a global function with example usage: orient_by_streamline(streamlines, standard, n_points, in_place, as_generator) and returns: _orient_by_sl_list, _orient_by_sl_generator