code: def rankdata(data, axis=None, use_missing=False):
      """Returns the rank (also known as order statistics) of each data point
      along the given axis.
  
      If some values are tied, their rank is averaged.
      If some values are masked, their rank is set to 0 if use_missing is False,
      or set to the average rank of the unmasked values if use_missing is True.
  
      Parameters
      ----------
      data : sequence
          Input data. The data is transformed to a masked array
      axis : {None,int}, optional
          Axis along which to perform the ranking.
          If None, the array is first flattened. An exception is raised if
          the axis is specified for arrays with a dimension larger than 2
      use_missing : bool, optional
          Whether the masked values have a rank of 0 (False) or equal to the
          average rank of the unmasked values (True).
  
      """
  
      def _rank1d(data, use_missing=False):
          n = data.count()
          rk = np.empty(data.size, dtype=float)
          idx = data.argsort()
          rk[idx[:n]] = np.arange(1, n + 1)
  
          if use_missing:
              rk[idx[n:]] = (n + 1) / 2.0
          else:
              rk[idx[n:]] = 0
  
          repeats = find_repeats(data.copy())
          for r in repeats[0]:
              condition = (data == r).filled(False)
              rk[condition] = rk[condition].mean()
          return rk
  
      data = ma.array(data, copy=False)
      if axis is None:
          if data.ndim > 1:
              return _rank1d(data.ravel(), use_missing).reshape(
                  data.shape
              )
          else:
              return _rank1d(data, use_missing)
      else:
          return ma.apply_along_axis(
              _rank1d, axis, data, use_missing
          ).view(ndarray)
  
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 7 for calling a global function with example usage: rankdata(data, axis, use_missing) and returns: rk, ma, _rank1d, _rank1d