code: def spilu(
      A,
      drop_tol=None,
      fill_factor=None,
      drop_rule=None,
      permc_spec=None,
      diag_pivot_thresh=None,
      relax=None,
      panel_size=None,
      options=None,
  ):
      """
      Compute an incomplete LU decomposition for a sparse, square matrix.
  
      The resulting object is an approximation to the inverse of `A`.
  
      Parameters
      ----------
      A : (N, N) array_like
          Sparse matrix to factorize
      drop_tol : float, optional
          Drop tolerance (0 <= tol <= 1) for an incomplete LU decomposition.
          (default: 1e-4)
      fill_factor : float, optional
          Specifies the fill ratio upper bound (>= 1.0) for ILU. (default: 10)
      drop_rule : str, optional
          Comma-separated string of drop rules to use.
          Available rules: ``basic``, ``prows``, ``column``, ``area``,
          ``secondary``, ``dynamic``, ``interp``. (Default: ``basic,area``)
  
          See SuperLU documentation for details.
  
      Remaining other options
          Same as for `splu`
  
      Returns
      -------
      invA_approx : scipy.sparse.linalg.SuperLU
          Object, which has a ``solve`` method.
  
      See also
      --------
      splu : complete LU decomposition
  
      Notes
      -----
      To improve the better approximation to the inverse, you may need to
      increase `fill_factor` AND decrease `drop_tol`.
  
      This function uses the SuperLU library.
  
      Examples
      --------
      >>> from scipy.sparse import csc_matrix
      >>> from scipy.sparse.linalg import spilu
      >>> A = csc_matrix([[1., 0., 0.], [5., 0., 2.], [0., -1., 0.]], dtype=float)
      >>> B = spilu(A)
      >>> x = np.array([1., 2., 3.], dtype=float)
      >>> B.solve(x)
      array([ 1. , -3. , -1.5])
      >>> A.dot(B.solve(x))
      array([ 1.,  2.,  3.])
      >>> B.solve(A.dot(x))
      array([ 1.,  2.,  3.])
      """
      if not isspmatrix_csc(A):
          A = csc_matrix(A)
          warn(
              "splu requires CSC matrix format", SparseEfficiencyWarning
          )
  
      # sum duplicates for non-canonical format
      A.sum_duplicates()
      A = A.asfptype()  # upcast to a floating point format
  
      M, N = A.shape
      if M != N:
          raise ValueError(
              "can only factor square matrices"
          )  # is this true?
  
      _options = dict(
          ILU_DropRule=drop_rule,
          ILU_DropTol=drop_tol,
          ILU_FillFactor=fill_factor,
          DiagPivotThresh=diag_pivot_thresh,
          ColPerm=permc_spec,
          PanelSize=panel_size,
          Relax=relax,
      )
      if options is not None:
          _options.update(options)
      return _superlu.gstrf(
          N,
          A.nnz,
          A.data,
          A.indices,
          A.indptr,
          ilu=True,
          options=_options,
      )
  
file_path: catboost/contrib/python/scipy/py2/scipy/sparse/linalg/dsolve/linsolve.py
imports: from __future__ import division, print_function, absolute_import
  from warnings import warn
  import numpy
  from numpy import asarray
  from scipy.sparse import isspmatrix_csc, isspmatrix_csr, isspmatrix, SparseEfficiencyWarning, csc_matrix, csr_matrix
  from scipy.linalg import LinAlgError
  from .None import _superlu
label_desc: Use image node_id 5 for calling a global function with example usage: spilu(A, drop_tol, fill_factor, drop_rule, permc_spec, diag_pivot_thresh, relax, panel_size, options) and returns: _superlu