o
    "g
                     @   s    d Z ddlZdgZdddZdS )z!
Introspection helper functions.
    Nopt_func_infoc           	         s   ddl m}m  | durt| fdd| D }n|}|durVt|i }| D ]%\}}i }| D ]\}}t fdd|D rL|||< q8|rS|||< q.|S |}|S )am  
    Returns a dictionary containing the currently supported CPU dispatched
    features for all optimized functions.

    Parameters
    ----------
    func_name : str (optional)
        Regular expression to filter by function name.

    signature : str (optional)
        Regular expression to filter by data type.

    Returns
    -------
    dict
        A dictionary where keys are optimized function names and values are
        nested dictionaries indicating supported targets based on data types.

    Examples
    --------
    Retrieve dispatch information for functions named 'add' or 'sub' and
    data types 'float64' or 'float32':

    >>> import numpy as np
    >>> dict = np.lib.introspect.opt_func_info(
    ...     func_name="add|abs", signature="float64|complex64"
    ... )
    >>> import json
    >>> print(json.dumps(dict, indent=2))
        {
          "absolute": {
            "dd": {
              "current": "SSE41",
              "available": "SSE41 baseline(SSE SSE2 SSE3)"
            },
            "Ff": {
              "current": "FMA3__AVX2",
              "available": "AVX512F FMA3__AVX2 baseline(SSE SSE2 SSE3)"
            },
            "Dd": {
              "current": "FMA3__AVX2",
              "available": "AVX512F FMA3__AVX2 baseline(SSE SSE2 SSE3)"
            }
          },
          "add": {
            "ddd": {
              "current": "FMA3__AVX2",
              "available": "FMA3__AVX2 baseline(SSE SSE2 SSE3)"
            },
            "FFF": {
              "current": "FMA3__AVX2",
              "available": "FMA3__AVX2 baseline(SSE SSE2 SSE3)"
            }
          }
        }

    r   )__cpu_targets_info__dtypeNc                    s    i | ]\}}  |r||qS  )search).0kv)func_patternr   V/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/numpy/lib/introspect.py
<dictcomp>I   s    z!opt_func_info.<locals>.<dictcomp>c                 3   s*    | ]} |p  |jV  qd S )N)r   name)r   c)r   sig_patternr   r   	<genexpr>V   s
    
z opt_func_info.<locals>.<genexpr>)numpy._core._multiarray_umathr   r   recompileitemsany)		func_name	signaturetargetsmatching_funcsmatching_sigsr   r	   matching_charscharsr   )r   r
   r   r   r   	   s0   :


)NN)__doc__r   __all__r   r   r   r   r   <module>   s    