code: def is_sparse(arr) -> bool:
      """
      Check whether an array-like is a 1-D pandas sparse array.
  
      Check that the one-dimensional array-like is a pandas sparse array.
      Returns True if it is a pandas sparse array, not another type of
      sparse array.
  
      Parameters
      ----------
      arr : array-like
          Array-like to check.
  
      Returns
      -------
      bool
          Whether or not the array-like is a pandas sparse array.
  
      Examples
      --------
      Returns `True` if the parameter is a 1-D pandas sparse array.
  
      >>> from pandas.api.types import is_sparse
      >>> is_sparse(pd.arrays.SparseArray([0, 0, 1, 0]))
      True
      >>> is_sparse(pd.Series(pd.arrays.SparseArray([0, 0, 1, 0])))
      True
  
      Returns `False` if the parameter is not sparse.
  
      >>> is_sparse(np.array([0, 0, 1, 0]))
      False
      >>> is_sparse(pd.Series([0, 1, 0, 0]))
      False
  
      Returns `False` if the parameter is not a pandas sparse array.
  
      >>> from scipy.sparse import bsr_matrix
      >>> is_sparse(bsr_matrix([0, 1, 0, 0]))
      False
  
      Returns `False` if the parameter has more than one dimension.
      """
      warnings.warn(
          "is_sparse is deprecated and will be removed in a future "
          "version. Check `isinstance(dtype, pd.SparseDtype)` instead.",
          DeprecationWarning,
          stacklevel=2,
      )
  
      dtype = getattr(arr, "dtype", arr)
      return isinstance(dtype, SparseDtype)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Callable
  import warnings
  import numpy
  from pandas._libs import Interval, Period, algos, lib
  from pandas._libs.tslibs import conversion
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.base import _registry
  from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, ExtensionDtype, IntervalDtype, PeriodDtype, SparseDtype
  from pandas.core.dtypes.generic import ABCIndex
  from pandas.core.dtypes.inference import is_array_like, is_bool, is_complex, is_dataclass, is_decimal, is_dict_like, is_file_like, is_float, is_hashable, is_integer, is_interval, is_iterator, is_list_like, is_named_tuple, is_nested_list_like, is_number, is_re, is_re_compilable, is_scalar, is_sequence
label_desc: Use image node_id 6 for calling a global function with example usage: is_sparse(arr) and returns: isinstance