U
    ¸mœdj  ã                   @  sº   d dl mZ d dlZd dlZd dlZd dlmZ dddddd	d
dddddgZdd„ eD ƒZdddœdd„Z	d#dddœdd„Z
edd�d$dddœdd„ƒZedd�d%dddd œd!d"„ƒZdS )&é    )ÚannotationsN)Ú	lru_cachez2.6.9z2.7.9z3.2.6z3.3.6z3.4.3z3.5z3.6z3.7z3.8z3.9z3.10z3.11c                 C  s$   g | ]}d   | d ¡dd… ¡‘qS )Ú.Né   )ÚjoinÚsplit©Ú.0Úx© r   úI/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/stdlib_list/base.pyÚ
<listcomp>   s     r   Ústr)ÚversionÚreturnc                 C  s<   | t kr"d |  d¡d d… ¡} n| tkr8td| › �ƒ‚| S )Nr   r   zNo such version: )Úlong_versionsr   r   Úshort_versionsÚ
ValueError©r   r   r   r   Úget_canonical_version   s
    r   z
str | Nonez	list[str]c                 C  sr   | dk	rt | ƒnd dd„ tjdd… D ƒ¡} tj d| › d�¡}t d|¡ ¡ }d	d
„ dd
„ | 	¡ D ƒD ƒ}|S )a¯  
    Given a ``version``, return a ``list`` of names of the Python Standard
    Libraries for that version.

    :param str|None version: The version (as a string) whose list of libraries you want
        (formatted as ``X.Y``, e.g. ``"2.7"`` or ``"3.10"``).

        If not specified, the current version of Python will be used.

    :return: A list of standard libraries from the specified version of Python
    :rtype: list
    Nr   c                 s  s   | ]}t |ƒV  qd S )N)r   r   r   r   r   Ú	<genexpr>4   s     zstdlib_list.<locals>.<genexpr>r   Úlistsz.txtÚstdlib_listc                 S  s   g | ]}|r|‘qS r   r   )r	   Úyr   r   r   r   ;   s      zstdlib_list.<locals>.<listcomp>c                 S  s   g | ]}|  ¡ ‘qS r   )Ústripr   r   r   r   r   ;   s     )
r   r   ÚsysÚversion_infoÚosÚpathÚpkgutilÚget_dataÚdecodeÚ
splitlines)r   Zmodule_list_fileÚdataÚresultr   r   r   r   #   s    ÿ
ýr   é   )Úmaxsizec                 C  s
   t | d�S )z(Internal cached version of `stdlib_list`r   )r   r   r   r   r   Ú_stdlib_list_with_cache@   s    r'   é   Úbool)Úmodule_namer   r   c                 C  s   t |d�}| |kS )a  
    Return a ``bool`` indicating if module ``module_name`` is in the list of stdlib
    symbols for python version ``version``. If ``version`` is ``None`` (default), the
    version of current python interpreter is used.

    Note that ``True`` will be returned for built-in modules too, since this project
    considers they are part of stdlib. See :issue:21.

    It relies on ``@lru_cache`` to cache the stdlib list and query results for similar
    calls. Therefore it is much more efficient than ``module_name in stdlib_list()``
    especially if you wish to perform multiple checks.

    :param str|None module_name: The module name (as a string) to query for.
    :param str|None version: The version (as a string) whose list of libraries you want
        (formatted as ``X.Y``, e.g. ``"2.7"`` or ``"3.10"``).

        If not specified, the current version of Python will be used.

    :return: A bool indicating if the given module name is part of standard libraries
        for the specified version of Python.
    :rtype: list
    r   )r'   )r*   r   Zref_listr   r   r   Ú	in_stdlibF   s    
r+   )N)N)N)Ú
__future__r   r   r   r   Ú	functoolsr   r   r   r   r   r'   r+   r   r   r   r   Ú<module>   s0   ô	