# Path: pubs/p3.py
#     def input():
#     def _get_raw_stdout():
#     def _get_raw_stderr():
#     def u_maybe(s):
#         def __init__(self, *args, **kwargs):
#         def write(self, s):
#     def _get_fake_stdio_ucontent(stdio):
#         def _print_message(self, message, file=None):
#     def _get_raw_stdout():
#     def _get_raw_stderr():
#     def u_maybe(s):
#         def __init__(self, *args, **kwargs):
#         def write(self, s):
#     def _fake_stdio(additional_out=False):
#     def _get_fake_stdio_ucontent(stdio):
# def isbasestr(obj):
#     class StdIO(io.BytesIO):
#     class ArgumentParser(argparse.ArgumentParser):
#     class StdIO(io.BytesIO):


import sys
import os
import shutil
from .p3 import urlparse, HTTPConnection, urlopen
    check_file(filepath)
    os.remove(filepath)


def write_file(filepath, data, mode='w'):
    """Write data to file.

    Data should be unicode except when binary mode is selected,
    in which case data is expected to be binary.
    """
    check_directory(os.path.dirname(filepath))
    if 'b' not in mode and sys.version_info < (3,):
        # _open returns in binary mode for python2
        # Data must be encoded
        data = data.encode('utf-8')
    with _open(filepath, mode) as f:
        f.write(data)


# dealing with formatless content

def content_type(path):
    parsed = urlparse(path)
    if parsed.scheme in ('http', 'https'):
        return 'url'
    else:
        return 'file'


def url_exists(url):

# Path: pubs/p3.py
#     def input():
#     def _get_raw_stdout():
#     def _get_raw_stderr():
#     def u_maybe(s):
#         def __init__(self, *args, **kwargs):
#         def write(self, s):
#     def _get_fake_stdio_ucontent(stdio):
#         def _print_message(self, message, file=None):
#     def _get_raw_stdout():
#     def _get_raw_stderr():
#     def u_maybe(s):
#         def __init__(self, *args, **kwargs):
#         def write(self, s):
#     def _fake_stdio(additional_out=False):
#     def _get_fake_stdio_ucontent(stdio):
# def isbasestr(obj):
#     class StdIO(io.BytesIO):
#     class ArgumentParser(argparse.ArgumentParser):
#     class StdIO(io.BytesIO):


# Path: pubs/content.py
import sys
import os
import shutil
from .p3 import urlparse, HTTPConnection, urlopen

    check_file(filepath)
    os.remove(filepath)


def write_file(filepath, data, mode='w'):
    """Write data to file.

    Data should be unicode except when binary mode is selected,
    in which case data is expected to be binary.
    """
    check_directory(os.path.dirname(filepath))
    if 'b' not in mode and sys.version_info < (3,):
        # _open returns in binary mode for python2
        # Data must be encoded
        data = data.encode('utf-8')
    with _open(filepath, mode) as f:
        f.write(data)


# dealing with formatless content

def content_type(path):
    parsed = urlparse(path)
    if parsed.scheme in ('http', 'https'):
        return 'url'
    else:
        return 'file'


def url_exists(url):

    parsed = urlparse(url)