HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/coreapi/compat.py
# coding: utf-8

import base64


__all__ = [
    'urlparse', 'string_types',
    'COMPACT_SEPARATORS', 'VERBOSE_SEPARATORS'
]


try:
    # Python 2
    import urlparse
    import cookielib as cookiejar

    string_types = (basestring,)
    text_type = unicode
    COMPACT_SEPARATORS = (b',', b':')
    VERBOSE_SEPARATORS = (b',', b': ')

    def b64encode(input_string):
        # Provide a consistently-as-unicode interface across 2.x and 3.x
        return base64.b64encode(input_string)

except ImportError:
    # Python 3
    import urllib.parse as urlparse
    from io import IOBase
    from http import cookiejar

    string_types = (str,)
    text_type = str
    COMPACT_SEPARATORS = (',', ':')
    VERBOSE_SEPARATORS = (',', ': ')

    def b64encode(input_string):
        # Provide a consistently-as-unicode interface across 2.x and 3.x
        return base64.b64encode(input_string.encode('ascii')).decode('ascii')


def force_bytes(string):
    if isinstance(string, string_types):
        return string.encode('utf-8')
    return string


def force_text(string):
    if not isinstance(string, string_types):
        return string.decode('utf-8')
    return string


try:
    import click
    console_style = click.style
except ImportError:
    def console_style(text, **kwargs):
        return text


try:
    from tempfile import _TemporaryFileWrapper
except ImportError:
    _TemporaryFileWrapper = None