§
    �Ÿjä  ã                   ól   — d Z ddlZddl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d	„ ZdS )
zQ
Utilities for getting information about IPython and the system it's running in.
é    N)Úrelease)Ú_sysinfoÚencodingc                 ó<  — t           j        rdt           j        fS t          j        d                     d¦  «        t          j        t          j        | ¬¦  «        }|                     ¦   «         \  }}|r)d|                     ¦   «                              d¦  «        fS dS )a"  Get short form of commit hash given directory `pkg_path`

    We get the commit hash from (in order of preference):

    * IPython.utils._sysinfo.commit
    * git output, if we are in a git repository

    If these fail, we return a not-found placeholder tuple

    Parameters
    ----------
    pkg_path : str
        directory containing package
        only used for getting commit from active repo

    Returns
    -------
    hash_from : str
        Where we got the hash from - description
    hash_str : str
        short form of hash
    Úinstallationzgit rev-parse --short HEADú )ÚstdoutÚstderrÚcwdÚ
repositoryÚascii)z(none found)z<not found>)	r   ÚcommitÚ
subprocessÚPopenÚsplitÚPIPEÚcommunicateÚstripÚdecode)Úpkg_pathÚprocÚrepo_commitÚ_s       úb/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/IPython/utils/sysinfo.pyÚpkg_commit_hashr      s�   € õ0 „ð /Ø�xœÐ.Ð.õ ÔÐ8×>Ò>¸sÑCÔCÝ#-¤?Ý#-¤?Ø (ð*ñ *ô *€Dð ×%Ò%Ñ'Ô'�N€K�Øð AØ˜[×.Ò.Ñ0Ô0×7Ò7¸Ñ@Ô@Ð@Ð@Ø(Ð(ó    c                 óò   — t          | ¦  «        \  }}t          t          j        | ||t          j        t          j        t          j        t          j        ¦   «         t          j        t          j
        ¬¦
  «
        S )zïReturn dict describing the context of this package

    Parameters
    ----------
    pkg_path : str
        path containing __init__.py for package

    Returns
    -------
    context : dict
        with named parameters of interest
    )
Úipython_versionÚipython_pathÚcommit_sourceÚcommit_hashÚsys_versionÚsys_executableÚsys_platformÚplatformÚos_nameÚdefault_encoding)r   Údictr   ÚversionÚsysÚ
executabler%   ÚosÚnamer   ÚDEFAULT_ENCODING)r   ÚsrcÚhshs      r   Úpkg_infor1   D   s`   € õ ˜xÑ(Ô(�H€CˆÝÝœØØØÝ”KÝ”~Ý”\ÝÔ"Ñ$Ô$Ý”Ý!Ô2ð
ñ 
ô 
ð 
r   c            
      óà   — t           j        } |                      |                      |                      |                      t          d¦  «        ¦  «        ¦  «        ¦  «        }t          |¦  «        S )zBReturn useful information about IPython and the system, as a dict.z..)r,   ÚpathÚrealpathÚdirnameÚabspathÚjoinÚ__file__r1   )Úpr3   s     r   Úget_sys_infor:   _   sL   € å
Œ€AØ�:Š:�a—i’i §	¢	¨!¯&ª&µ¸4Ñ*@Ô*@Ñ AÔ AÑBÔBÑCÔC€DÝ�D‰>Œ>Ðr   c                  óB   — t          j        t          ¦   «         ¦  «        S )au  Return useful information about IPython and the system, as a string.

    Examples
    --------
    ::
    
        In [2]: print(sys_info())
        {'commit_hash': '144fdae',      # random
         'commit_source': 'repository',
         'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
         'ipython_version': '0.11.dev',
         'os_name': 'posix',
         'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick',
         'sys_executable': '/usr/bin/python',
         'sys_platform': 'linux2',
         'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \n[GCC 4.4.5]'}
    )ÚpprintÚpformatr:   © r   r   Úsys_infor?   e   s   € õ$ Œ>�,™.œ.Ñ)Ô)Ð)r   c                  ón   — ddl } |                      dt          d¬¦  «         t          j        ¦   «         pdS )aœ  DEPRECATED

    Return the effective number of CPUs in the system as an integer.

    This cross-platform function makes an attempt at finding the total number of
    available CPUs in the system, as returned by various underlying system and
    python calls.

    If it can't find a sensible answer, it returns 1 (though an error *may* make
    it return a large positive number that's actually incorrect).
    r   NzG`num_cpus` is deprecated since IPython 8.0. Use `os.cpu_count` instead.é   )Ú
stacklevelé   )ÚwarningsÚwarnÚDeprecationWarningr,   Ú	cpu_count)rD   s    r   Únum_cpusrH   z   sD   € ð €O€O€Oà‡M‚MØQÝØð ñ ô ð õ Œ<‰>Œ>Ð˜QÐr   )Ú__doc__r,   r%   r<   r*   r   ÚIPython.corer   ÚIPython.utilsr   r   r   r1   r:   r?   rH   r>   r   r   ú<module>rL      sÁ   ððð ð 
€	€	€	Ø €€€Ø €€€Ø 
€
€
€
Ø Ð Ð Ð à  Ð  Ð  Ð  Ð  Ð  Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð#)ð #)ð #)ðL
ð 
ð 
ð6ð ð ð*ð *ð *ð*ð ð ð ð r   