code: def ledoit_wolf(X, assume_centered=False, block_size=1000):
      """Estimates the shrunk Ledoit-Wolf covariance matrix.
  
      Read more in the :ref:`User Guide <shrunk_covariance>`.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Data from which to compute the covariance estimate
  
      assume_centered : boolean, default=False
          If True, data are not centered before computation.
          Useful to work with data whose mean is significantly equal to
          zero but is not exactly zero.
          If False, data are centered before computation.
  
      block_size : int, default=1000
          Size of the blocks into which the covariance matrix will be split.
          This is purely a memory optimization and does not affect results.
  
      Returns
      -------
      shrunk_cov : array-like, shape (n_features, n_features)
          Shrunk covariance.
  
      shrinkage : float
          Coefficient in the convex combination used for the computation
          of the shrunk estimate.
  
      Notes
      -----
      The regularized (shrunk) covariance is:
  
      (1 - shrinkage)*cov
        + shrinkage * mu * np.identity(n_features)
  
      where mu = trace(cov) / n_features
  
      """
      X = np.asarray(X)
      # for only one feature, the result is the same whatever the shrinkage
      if len(X.shape) == 2 and X.shape[1] == 1:
          if not assume_centered:
              X = X - X.mean()
          return np.atleast_2d((X**2).mean()), 0.0
      if X.ndim == 1:
          X = np.reshape(X, (1, -1))
          warnings.warn(
              "Only one sample available. "
              "You may want to reshape your data array"
          )
          n_samples = 1
          n_features = X.size
      else:
          n_samples, n_features = X.shape
  
      # get Ledoit-Wolf shrinkage
      shrinkage = ledoit_wolf_shrinkage(
          X, assume_centered=assume_centered, block_size=block_size
      )
      emp_cov = empirical_covariance(X, assume_centered=assume_centered)
      mu = np.sum(np.trace(emp_cov)) / n_features
      shrunk_cov = (1.0 - shrinkage) * emp_cov
      shrunk_cov.flat[:: n_features + 1] += shrinkage * mu
  
      return shrunk_cov, shrinkage
  
imports: from __future__ import division
  import warnings
  import numpy
  from .empirical_covariance_ import empirical_covariance, EmpiricalCovariance
  from ..externals.six.moves import xrange
  from ..utils import check_array
label_desc: Use image node_id 3 for calling a global function with example usage: ledoit_wolf(X, assume_centered, block_size) and returns: shrunk_cov,  shrinkage, np,  int