code: def shapiro(x):
      """
      Perform the Shapiro-Wilk test for normality.
  
      The Shapiro-Wilk test tests the null hypothesis that the
      data was drawn from a normal distribution.
  
      Parameters
      ----------
      x : array_like
          Array of sample data.
  
      Returns
      -------
      W : float
          The test statistic.
      p-value : float
          The p-value for the hypothesis test.
  
      See Also
      --------
      anderson : The Anderson-Darling test for normality
      kstest : The Kolmogorov-Smirnov test for goodness of fit.
  
      Notes
      -----
      The algorithm used is described in [4]_ but censoring parameters as
      described are not implemented. For N > 5000 the W test statistic is accurate
      but the p-value may not be.
  
      The chance of rejecting the null hypothesis when it is true is close to 5%
      regardless of sample size.
  
      References
      ----------
      .. [1] https://www.itl.nist.gov/div898/handbook/prc/section2/prc213.htm
      .. [2] Shapiro, S. S. & Wilk, M.B (1965). An analysis of variance test for
             normality (complete samples), Biometrika, Vol. 52, pp. 591-611.
      .. [3] Razali, N. M. & Wah, Y. B. (2011) Power comparisons of Shapiro-Wilk,
             Kolmogorov-Smirnov, Lilliefors and Anderson-Darling tests, Journal of
             Statistical Modeling and Analytics, Vol. 2, pp. 21-33.
      .. [4] ALGORITHM AS R94 APPL. STATIST. (1995) VOL. 44, NO. 4.
  
      Examples
      --------
      >>> from scipy import stats
      >>> np.random.seed(12345678)
      >>> x = stats.norm.rvs(loc=5, scale=3, size=100)
      >>> stats.shapiro(x)
      (0.9772805571556091, 0.08144091814756393)
  
      """
      x = np.ravel(x)
  
      N = len(x)
      if N < 3:
          raise ValueError("Data must be at least length 3.")
  
      a = zeros(N, "f")
      init = 0
  
      y = sort(x)
      a, w, pw, ifault = statlib.swilk(y, a[: N // 2], init)
      if ifault not in [0, 2]:
          warnings.warn(
              "Input data for shapiro has range zero. The results "
              "may not be accurate."
          )
      if N > 5000:
          warnings.warn("p-value may not be accurate for N > 5000.")
  
      return w, pw
  
imports: from __future__ import division, print_function, absolute_import
  import math
  import warnings
  from collections import namedtuple
  import numpy
  from numpy import isscalar, r_, log, around, unique, asarray, zeros, arange, sort, amin, amax, any, atleast_1d, sqrt, ceil, floor, array, compress, pi, exp, ravel, count_nonzero, sin, cos, arctan2, hypot
  from scipy._lib.six import string_types
  from scipy import optimize
  from scipy import special
  from .None import statlib
  from .None import stats
  from .stats import find_repeats, _contains_nan
  from .contingency import chi2_contingency
  from .None import distributions
  from ._distn_infrastructure import rv_generic
label_desc: Use image node_id 22 for calling a global function with example usage: shapiro(x) and returns: w,  pw