code: def theilslopes(y, x=None, alpha=0.95):
      r"""
      Computes the Theil-Sen estimator for a set of points (x, y).
  
      `theilslopes` implements a method for robust linear regression.  It
      computes the slope as the median of all slopes between paired values.
  
      Parameters
      ----------
      y : array_like
          Dependent variable.
      x : array_like or None, optional
          Independent variable. If None, use ``arange(len(y))`` instead.
      alpha : float, optional
          Confidence degree between 0 and 1. Default is 95% confidence.
          Note that `alpha` is symmetric around 0.5, i.e. both 0.1 and 0.9 are
          interpreted as "find the 90% confidence interval".
  
      Returns
      -------
      medslope : float
          Theil slope.
      medintercept : float
          Intercept of the Theil line, as ``median(y) - medslope*median(x)``.
      lo_slope : float
          Lower bound of the confidence interval on `medslope`.
      up_slope : float
          Upper bound of the confidence interval on `medslope`.
  
      See also
      --------
      siegelslopes : a similar technique with repeated medians
  
  
      Notes
      -----
      For more details on `theilslopes`, see `stats.theilslopes`.
  
      """
      y = ma.asarray(y).flatten()
      if x is None:
          x = ma.arange(len(y), dtype=float)
      else:
          x = ma.asarray(x).flatten()
          if len(x) != len(y):
              raise ValueError(
                  "Incompatible lengths ! (%s<>%s)" % (len(y), len(x))
              )
  
      m = ma.mask_or(ma.getmask(x), ma.getmask(y))
      y._mask = x._mask = m
      # Disregard any masked elements of x or y
      y = y.compressed()
      x = x.compressed().astype(float)
      # We now have unmasked arrays so can use `stats.theilslopes`
      return stats_theilslopes(y, x, alpha=alpha)
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy import ndarray
  import numpy.ma
  from numpy.ma import masked, nomask
  from scipy._lib.six import iteritems
  import itertools
  import warnings
  from collections import namedtuple
  from .None import distributions
  import scipy.special
  from ._stats_mstats_common import _find_repeats, linregress, theilslopes, siegelslopes
label_desc: Use image node_id 17 for calling a global function with example usage: theilslopes(y, x, alpha) and returns: stats_theilslopes