
    0Ph                         ddZ ddZd S )Nc                    |dt          | d          r/t          | j        d          r| j                                        }nId t          | j        d                   D             }n$t          |d          r|                                }t          t          |                    t          |          k    rt          d          |S )a(  Check feature names.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        Input data.

    feature_names : None or array-like of shape (n_names,), dtype=str
        Feature names to check or `None`.

    Returns
    -------
    feature_names : list of str
        Feature names validated. If `feature_names` is `None`, then a list of
        feature names is provided, i.e. the column names of a pandas dataframe
        or a generic list of feature names (e.g. `["x0", "x1", ...]`) for a
        NumPy array.
    Ncolumnstolistc                     g | ]}d | S )x ).0is     \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/inspection/_pd_utils.py
<listcomp>z(_check_feature_names.<locals>.<listcomp>   s    @@@WWW@@@       z,feature_names should not contain duplicates.)hasattrr   r   rangeshapelenset
ValueError)Xfeature_namess     r
   _check_feature_namesr      s    & 1i   	AWQY%A%A 	AI,,..MM A@eAGAJ.?.?@@@MM		)	) /%,,..
3}#m"4"444GHHHr   c                     t          | t                    rQ|t          d| d          	 |                    |           S # t          $ r}t          d| d          |d}~ww xY w| S )a  Get feature index.

    Parameters
    ----------
    fx : int or str
        Feature index or name.

    feature_names : list of str, default=None
        All feature names from which to search the indices.

    Returns
    -------
    idx : int
        Feature index.
    Nz+Cannot plot partial dependence for feature z since the list of feature names was not provided, neither as column names of a pandas data-frame nor via the feature_names parameter.zFeature z not in feature_names)
isinstancestrr   index)fxr   es      r
   _get_feature_indexr   (   s      "c L b     	L &&r*** 	L 	L 	LCCCCDD!K	LIs   A 
A$AA$)N)r   r   r   r   r
   <module>r      s8   
       F     r   