Ë
    7;h  ã                   ó    — 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	 ddl
mZmZ dedeeef   fd„Zdedefd	„Zdefd
„Zdefd„Zd„ Zy)zQ
Utilities for getting information about IPython and the system it's running in.
é    N)ÚPath)Úrelease)Ú_sysinfoÚencodingÚpkg_pathÚreturnc                 ó<  — t         j                  rdt         j                  fS t        j                  dj	                  d«      t        j
                  t        j
                  | ¬«      }|j                  «       \  }}|r!d|j                  «       j                  d«      fS y)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)r   ÚprocÚrepo_commitÚ_s       úf/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/IPython/utils/sysinfo.pyÚpkg_commit_hashr       s„   € ô0 ‡‚ØœxŸ™Ð.Ð.ô ×ÑÐ8×>Ñ>¸sÓCÜ#-§?¡?Ü#-§?¡?Ø (ô*€Dð ×%Ñ%Ó'�N€K�ÙØ˜[×.Ñ.Ó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_infor3   F   s`   € ô ˜xÓ(�H€CˆÜÜŸ™ØØØÜ—K‘KÜ—~‘~Ü—\‘\Ü×"Ñ"Ó$Ü—‘Ü!×2Ñ2ô
ð 
r   c                  óz   — t        t        d«      j                  «       j                  } t	        t        | «      «      S )zBReturn useful information about IPython and the system, as a dict.z..)r   Ú__file__ÚresolveÚparentr3   Ústr)Úpaths    r   Úget_sys_infor:   a   s,   € ä”˜$Ó×'Ñ'Ó)×0Ñ0€DÜ”C˜“IÓÐr   c                  ó<   — 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?   f   s   € ô$ �>‰>œ,›.Ó)Ð)r   c                  ój   — ddl } | j                  dt        d¬«       t        j                  «       xs 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   {   s4   € ó à‡M�MØQÜØð ô ô �<‰<‹>Ò˜QÐr   )Ú__doc__r.   r'   r<   r,   r   Úpathlibr   ÚIPython.corer   ÚIPython.utilsr   r   r8   Útupler   r*   r3   r:   r?   rH   r>   r   r   Ú<module>rN      sp   ðñó 
Û Û Û 
Û å å  ß ,ð#)˜cð #) e¨C°¨H¡oó #)ðL
�sð 
˜tó 
ð6�dó ð
*�#ó *ó*r   