code: def siegelslopes(y, x=None, method="hierarchical"):
      r"""
      Computes the Siegel estimator for a set of points (x, y).
  
      `siegelslopes` implements a method for robust linear regression
      using repeated medians to fit a line to the points (x, y).
      The method is robust to outliers with an asymptotic breakdown point
      of 50%.
  
      Parameters
      ----------
      y : array_like
          Dependent variable.
      x : array_like or None, optional
          Independent variable. If None, use ``arange(len(y))`` instead.
      method : {'hierarchical', 'separate'}
          If 'hierarchical', estimate the intercept using the estimated
          slope ``medslope`` (default option).
          If 'separate', estimate the intercept independent of the estimated
          slope. See Notes for details.
  
      Returns
      -------
      medslope : float
          Estimate of the slope of the regression line.
      medintercept : float
          Estimate of the intercept of the regression line.
  
      See also
      --------
      theilslopes : a similar technique without repeated medians
  
      Notes
      -----
      For more details on `siegelslopes`, see `scipy.stats.siegelslopes`.
  
      """
      y = ma.asarray(y).ravel()
      if x is None:
          x = ma.arange(len(y), dtype=float)
      else:
          x = ma.asarray(x).ravel()
          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.siegelslopes`
      return stats_siegelslopes(y, x)
  
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 18 for calling a global function with example usage: siegelslopes(y, x, method) and returns: stats_siegelslopes