
    {KgY                         ddZ ddZy )Nc                 n   |ft        | d      r1t        | j                  d      r| j                  j                         }nEt        | j                  d         D cg c]  }d| 	 }}nt        |d      r|j                         }t        t        |            t        |      k7  rt        d      |S c c}w )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.
    columnstolist   xz,feature_names should not contain duplicates.)hasattrr   r   rangeshapelenset
ValueError)Xfeature_namesis      `/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/sklearn/inspection/_pd_utils.py_check_feature_namesr      s    & 1i WQYY%AII,,.M /4AGGAJ.?@.?qW.?M@		)%,,.
3}#m"44GHH As   B2c                     t        | t              r#|t        d| d      	 |j                  |       S | S # t        $ r}t        d| d      |d}~ww xY w)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 =bV D  	L &&r** I  	Lxv-BCD!K	Ls   6 	AAA)N)r   r        r   <module>r      s    Fr   