code: def _delays_to_slice(delays):
      """Find the slice to be taken in order to remove missing values."""
      # Negative values == cut off rows at the end
      min_delay = None if delays[-1] <= 0 else delays[-1]
      # Positive values == cut off rows at the end
      max_delay = None if delays[0] >= 0 else delays[0]
      return slice(min_delay, max_delay)
  
imports: import numbers
  import numpy
  from scipy.stats import pearsonr
  from ..fixes import pinv
  from ..utils import _validate_type, fill_doc, verbose
  from .base import BaseEstimator, _check_estimator, get_coef
  from .time_delaying_ridge import TimeDelayingRidge
label_desc: Use image node_id 3 for calling a global function with example usage: _delays_to_slice(delays) and returns: slice