
    @g                     (   d Z dZddlZ	 eZeZeZeZddlm	Z
 ddlmZ ddlmZ ddlmZ 	 dd	lmZ d Zd Zd Zd Zd Zy# eef$ r# eZeZeZeZddlm
Z
 ddlmZ ddlmZ ddlmZ Y @w xY w# e$ r 	 dd	lmZ n# eef$ r	 dd
lmZ Y nw xY wY _w xY w)aK  
Compatibility with Python 2 and 3.

This module exposes aliases and functions that make it easier to write Python
code that is compatible with Python 2 and Python 3.

.. data:: basestring

   Alias for :func:`python2:basestring` (in Python 2) or :class:`python3:str`
   (in Python 3). See also :func:`is_string()`.

.. data:: HTMLParser

   Alias for :class:`python2:HTMLParser.HTMLParser` (in Python 2) or
   :class:`python3:html.parser.HTMLParser` (in Python 3).

.. data:: interactive_prompt

   Alias for :func:`python2:raw_input()` (in Python 2) or
   :func:`python3:input()` (in Python 3).

.. data:: StringIO

   Alias for :class:`python2:StringIO.StringIO` (in Python 2) or
   :class:`python3:io.StringIO` (in Python 3).

.. data:: unicode

   Alias for :func:`python2:unicode` (in Python 2) or :class:`python3:str` (in
   Python 3). See also :func:`coerce_string()`.

.. data:: monotonic

   Alias for :func:`python3:time.monotonic()` (in Python 3.3 and higher) or
   `monotonic.monotonic()` (a `conditional dependency
   <https://pypi.org/project/monotonic/>`_ on older Python versions).
)
HTMLParserStringIO
basestringcoerce_stringinteractive_prompt	is_string
is_unicode	monotonicname2codepointon_macos
on_windowsunichrunicodewhich    N)find_executable)r   )r   )r
   )r   )r	   )timec                 2    t        |       r| S t        |       S )z
    Coerce any value to a Unicode string (:func:`python2:unicode` in Python 2 and :class:`python3:str` in Python 3).

    :param value: The value to coerce.
    :returns: The value coerced to a Unicode string.
    )r   r   values    I/var/www/openai/venv/lib/python3.12/site-packages/humanfriendly/compat.pyr   r   e   s     e$58'%.8    c                 "    t        | t              S )z
    Check if a value is a :func:`python2:basestring` (in Python 2) or :class:`python3:str` (in Python 3) object.

    :param value: The value to check.
    :returns: :data:`True` if the value is a string, :data:`False` otherwise.
    )
isinstancer   r   s    r   r   r   o   s     eZ((r   c                 "    t        | t              S )z
    Check if a value is a :func:`python2:unicode` (in Python 2) or :class:`python2:str` (in Python 3) object.

    :param value: The value to check.
    :returns: :data:`True` if the value is a Unicode string, :data:`False` otherwise.
    )r   r   r   s    r   r   r   y   s     eW%%r   c                  @    t         j                  j                  d      S )zw
    Check if we're running on Apple MacOS.

    :returns: :data:`True` if running MacOS, :data:`False` otherwise.
    darwinsysplatform
startswith r   r   r   r      s     <<""8,,r   c                  @    t         j                  j                  d      S )z
    Check if we're running on the Microsoft Windows OS.

    :returns: :data:`True` if running Windows, :data:`False` otherwise.
    winr   r!   r   r   r   r      s     <<""5))r   ) __doc____all__r   r   r   r   	raw_inputr   distutils.spawnr   r   r   r   htmlentitydefsr
   ImportError	NameErrorstrchrinputshutilhtml.parseriohtml.entitiesr   r	   RuntimeErrorr   r   r   r   r   r!   r   r   <module>r3      s   $L$ -GFJ"8%!-+9)&-*A 	Y 	-GFJ&,	-  ++'& + 	+++sF    A A. 'A+*A+.B4A;:B;BB
BBB