a
    IDg                     @   s2  d Z dZddlZzDe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 W nV eefy   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 n0 zdd	lmZ W nH ey   zdd	lmZ W n" eefy   dd
lmZ Y n0 Y n0 dd Zdd Zdd Zdd Zdd ZdS )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                 C   s   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   value r   e/mounts/lovelace/software/anaconda3/envs/paleomix/lib/python3.9/site-packages/humanfriendly/compat.pyr   e   s    r   c                 C   s
   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   r   r   r   r   o   s    r   c                 C   s
   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   r   r   r   r   y   s    r   c                   C   s   t jdS )zw
    Check if we're running on Apple MacOS.

    :returns: :data:`True` if running MacOS, :data:`False` otherwise.
    darwinsysplatform
startswithr   r   r   r   r
      s    r
   c                   C   s   t 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    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   r   <module>   s@   &


	