code: def generate_trends(n_features=17, length=41):
      """Generate linearly-varying signals, with zero mean.
  
      Parameters
      ----------
      n_features, length : int
          respectively number of signals and number of samples to generate.
  
      Returns
      -------
      trends : numpy.ndarray, shape (length, n_features)
          output signals, one per column.
      """
      rng = _rng()
      trends = scipy.signal.detrend(
          np.linspace(0, 1.0, length), type="constant"
      )
      trends = np.repeat(np.atleast_2d(trends).T, n_features, axis=1)
      factors = rng.standard_normal(size=n_features)
      return trends * factors
  
imports: import os.path
  import numpy
  import pytest
  import scipy.signal
  from pandas import read_csv
  from nilearn import signal
  from nilearn.conftest import _rng
  from nilearn.signal import clean
label_desc: Use image node_id 2 for calling a global function with example usage: generate_trends(n_features, length) and returns: unknown