
    ZPh                        d Z ddlZddlZddlZddlmZ ddlmZmZ d Z	dZ
d ZdZ G d	 d
          Zej        dk    r e	e
          Z
 e	e          Zej                            dee
feefg          d             Zd Zd ZdS )zTest utilities for docstring.    N)Substitution)_n_jobs_docstring_random_state_docstringc                 f    d                     d |                     d          D                       S )z_Compatibility with Python 3.13+.

    xref: https://github.com/python/cpython/issues/81283
    
c                 6    g | ]}t          j        |          S  )textwrapdedent).0lines     c/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/imblearn/utils/tests/test_docstring.py
<listcomp>z%_dedent_docstring.<locals>.<listcomp>   s"    NNNhod++NNN    )joinsplit)	docstrings    r   _dedent_docstringr      s1    
 99NN	8M8MNNNOOOr   z@A function.

    Parameters
    ----------
    xxx

    yyy
    c                 
    | |fS )zLA function.

    Parameters
    ----------
    {param_1}

    {param_2}
    r	   param_1param_2s     r   funcr   !   s     Gr   z=A class.

    Parameters
    ----------
    xxx

    yyy
    c                       e Zd ZdZd ZdS )clszIA class.

    Parameters
    ----------
    {param_1}

    {param_2}
    c                 "    || _         || _        d S )Nr   )selfr   r   s      r   __init__zcls.__init__A   s    r   N)__name__
__module____qualname____doc__r   r	   r   r   r   r   7   s-             r   r   )      zobj, obj_docstringc                 T     t          dd          |           }|j        |k    sJ d S )Nxxxyyyr   )r   r"   )objobj_docstringobj_injected_docstrings      r   test_docstring_injectr+   K   s<     H\%GGGLL!)]::::::r   c                  2    dt           v sJ dt          v sJ d S )Nrandom_staten_jobs)r   r   r	   r   r   test_docstring_templater/   S   s,    44444(((((((r   c                  |    t          dd          } d| _         t          dd          |           } | j        J dS )zCheck that we don't raise a warning if the code is executed with -OO.

    Non-regression test for:
    https://github.com/scikit-learn-contrib/imbalanced-learn/issues/945
    r&   r'   r   N)r   r"   r   )instances    r   test_docstring_with_python_OOr2   X   sO     5%000HH9|E5999(CCH#####r   )r"   sysr
   pytestimblearn.utilsr   imblearn.utils._docstringr   r   r   func_docstringr   cls_docstringr   version_infomarkparametrizer+   r/   r2   r	   r   r   <module>r<      sE   # #
 


   ' ' ' ' ' ' P P P P P P P PP P P	 	 	        w&&~66N%%m44M D.1C3GH ; ; ;
) ) )
$ $ $ $ $r   