
    Wh                    4    d dl mZ d dlmZ ddZddZd	dZy)
    )annotations)warnc                 p   ddl } ddlm} ddl}t	         ||j
                        j                        }| j                         }d}	 |re| j                  |      }|j                  |      s*t        |j                  dd      x}r#|j                  d      r|j                  }|dz  }n	 ~|S |re	 ~|S # ~w xY w)zFind the first place in the stack that is not inside narwhals.

    Returns:
        Stacklevel.

    Taken from:
    https://github.com/pandas-dev/pandas/blob/ab89c53f48df67709a533b6a95ce3d911871a0a8/pandas/util/_exceptions.py#L30-L51
    r   N)Pathco_qualnamezsingledispatch.   )inspectpathlibr   narwhalsstr__file__parentcurrentframegetfile
startswithgetattrf_codef_back)r	   r   nwpkg_dirframenfnamequalnames           N/var/www/html/jupyter_env/lib/python3.12/site-packages/narwhals/_exceptions.pyfind_stacklevelr      s     $r{{#**+G   "E	AOOE*E($U\\=$GGG''(9:Q H'   H s   A B2 +B2 2B5c                8    t        | t        t                      y)zIssue a deprecation warning.

    Arguments:
        message: The message associated with the warning.
        _version: Narwhals version when the warning was introduced. Just used for internal
            bookkeeping.
    messagecategory
stacklevelN)r   DeprecationWarningr   )r   _versions     r   issue_deprecation_warningr$   0   s     	#5/BST    c                0    t        | |t                      y )Nr   )r   r   )r   r    s     r   issue_warningr'   ;   s    88IJr%   N)returnint)r   r   r#   r   r(   None)r   r   r    ztype[Warning]r(   r*   )
__future__r   warningsr   r   r$   r'    r%   r   <module>r.      s    " 'TUKr%   