# Path: discretize/utils/code_utils.py
# def is_scalar(f):
#     """Determine if the input argument is a scalar.
# 
#     The function **is_scalar** returns *True* if the input is an integer,
#     float or complex number. The function returns *False* otherwise.
# 
#     Parameters
#     ----------
#     f :
#         Any input quantity
# 
#     Returns
#     -------
#     bool :
# 
#         - *True* if the input argument is an integer, float or complex number
#         - *False* otherwise
# 
# 
#     """
# 
#     if isinstance(f, SCALARTYPES):
#         return True
#     elif isinstance(f, np.ndarray) and f.size == 1 and isinstance(f[0], SCALARTYPES):
#         return True
#     return False
# 
# def deprecate_function(new_function, old_name, removal_version=None, future_warn=False):
#     if future_warn:
#         Warning = FutureWarning
#     else:
#         Warning = DeprecationWarning
#     new_name = new_function.__name__
#     if removal_version is not None:
#         tag = f" It will be removed in version {removal_version} of discretize."
#     else:
#         tag = " It will be removed in a future version of discretize."
# 
#     def dep_function(*args, **kwargs):
#         warnings.warn(
#             f"{old_name} has been deprecated, please use {new_name}." + tag,
#             Warning,
#         )
#         return new_function(*args, **kwargs)
# 
#     doc = f"""
#     `{old_name}` has been deprecated. See `{new_name}` for documentation
# 
#     See Also
#     --------
#     {new_name}
#     """
#     dep_function.__doc__ = doc
#     return dep_function


import numpy as np
import scipy.sparse as sp
import warnings
from discretize.utils.code_utils import is_scalar, deprecate_function
    Plot the inverse property tensors.

    .. collapse:: Expand to show scripting for plot

        >>> fig2 = plt.figure(figsize=(15, 4))
        >>> ax2 = 4*[None]
        >>> for ii in range(0, 4):
        ...     ax2[ii] = fig2.add_axes([0.05+0.22*ii, 0.05, 0.18, 0.9])
        ...     ax2[ii].imshow(
        ...         Minv_list[ii].todense(), interpolation='none', cmap='binary', vmax=1.
        ...     )
        ...     ax2[ii].set_title('$M^{-1}$ (' + case_list[ii] + ')', fontsize=24)
        >>> cax2 = fig2.add_axes([0.92, 0.15, 0.01, 0.7])
        >>> norm2 = mpl.colors.Normalize(vmin=0., vmax=1.)
        >>> cbar2 = mpl.colorbar.ColorbarBase(
        ...     cax2, norm=norm2, orientation="vertical", cmap=mpl.cm.binary
        ... )
        >>> plt.show()
    """

    if "returnMatrix" in kwargs:
        warnings.warn(
            "The returnMatrix keyword argument has been deprecated, please use return_matrix. "
            "This will be removed in discretize 1.0.0",
            DeprecationWarning,
        )
        return_matrix = kwargs["returnMatrix"]

    propType = TensorType(mesh, tensor)


# Path: discretize/utils/code_utils.py
# def is_scalar(f):
#     """Determine if the input argument is a scalar.
# 
#     The function **is_scalar** returns *True* if the input is an integer,
#     float or complex number. The function returns *False* otherwise.
# 
#     Parameters
#     ----------
#     f :
#         Any input quantity
# 
#     Returns
#     -------
#     bool :
# 
#         - *True* if the input argument is an integer, float or complex number
#         - *False* otherwise
# 
# 
#     """
# 
#     if isinstance(f, SCALARTYPES):
#         return True
#     elif isinstance(f, np.ndarray) and f.size == 1 and isinstance(f[0], SCALARTYPES):
#         return True
#     return False
# 
# def deprecate_function(new_function, old_name, removal_version=None, future_warn=False):
#     if future_warn:
#         Warning = FutureWarning
#     else:
#         Warning = DeprecationWarning
#     new_name = new_function.__name__
#     if removal_version is not None:
#         tag = f" It will be removed in version {removal_version} of discretize."
#     else:
#         tag = " It will be removed in a future version of discretize."
# 
#     def dep_function(*args, **kwargs):
#         warnings.warn(
#             f"{old_name} has been deprecated, please use {new_name}." + tag,
#             Warning,
#         )
#         return new_function(*args, **kwargs)
# 
#     doc = f"""
#     `{old_name}` has been deprecated. See `{new_name}` for documentation
# 
#     See Also
#     --------
#     {new_name}
#     """
#     dep_function.__doc__ = doc
#     return dep_function


# Path: discretize/utils/matrix_utils.py
import numpy as np
import scipy.sparse as sp
import warnings
from discretize.utils.code_utils import is_scalar, deprecate_function

    Plot the inverse property tensors.

    .. collapse:: Expand to show scripting for plot

        >>> fig2 = plt.figure(figsize=(15, 4))
        >>> ax2 = 4*[None]
        >>> for ii in range(0, 4):
        ...     ax2[ii] = fig2.add_axes([0.05+0.22*ii, 0.05, 0.18, 0.9])
        ...     ax2[ii].imshow(
        ...         Minv_list[ii].todense(), interpolation='none', cmap='binary', vmax=1.
        ...     )
        ...     ax2[ii].set_title('$M^{-1}$ (' + case_list[ii] + ')', fontsize=24)
        >>> cax2 = fig2.add_axes([0.92, 0.15, 0.01, 0.7])
        >>> norm2 = mpl.colors.Normalize(vmin=0., vmax=1.)
        >>> cbar2 = mpl.colorbar.ColorbarBase(
        ...     cax2, norm=norm2, orientation="vertical", cmap=mpl.cm.binary
        ... )
        >>> plt.show()
    """

    if "returnMatrix" in kwargs:
        warnings.warn(
            "The returnMatrix keyword argument has been deprecated, please use return_matrix. "
            "This will be removed in discretize 1.0.0",
            DeprecationWarning,
        )
        return_matrix = kwargs["returnMatrix"]

    propType = TensorType(mesh, tensor)


    if is_scalar(tensor):