NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /opt/imunify360/venv/lib/python3.11/site-packages/jsonschema/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //opt/imunify360/venv/lib/python3.11/site-packages/jsonschema/compat.py
"""
Python 2/3 compatibility helpers.

Note: This module is *not* public API.
"""
import contextlib
import operator
import sys


try:
    from collections.abc import MutableMapping, Sequence  # noqa
except ImportError:
    from collections import MutableMapping, Sequence  # noqa

PY3 = sys.version_info[0] >= 3

if PY3:
    zip = zip
    from functools import lru_cache
    from io import StringIO as NativeIO
    from urllib.parse import (
        unquote, urljoin, urlunsplit, SplitResult, urlsplit
    )
    from urllib.request import pathname2url, urlopen
    str_types = str,
    int_types = int,
    iteritems = operator.methodcaller("items")
else:
    from itertools import izip as zip  # noqa
    from io import BytesIO as NativeIO
    from urlparse import urljoin, urlunsplit, SplitResult, urlsplit
    from urllib import pathname2url, unquote  # noqa
    import urllib2  # noqa
    def urlopen(*args, **kwargs):
        return contextlib.closing(urllib2.urlopen(*args, **kwargs))

    str_types = basestring
    int_types = int, long
    iteritems = operator.methodcaller("iteritems")

    from functools32 import lru_cache


def urldefrag(url):
    if "#" in url:
        s, n, p, q, frag = urlsplit(url)
        defrag = urlunsplit((s, n, p, q, ""))
    else:
        defrag = url
        frag = ""
    return defrag, frag


# flake8: noqa

NineSec Team - 2022