# Path: ipwb/replay.py
# UPLOAD_FOLDER = tempfile.gettempdir()
# ALLOWED_EXTENSIONS = ('.warc', '.warc.gz')
# def formatters():
# def set_server_header(response):
# def allowed_file(filename):
# def upload_file():
# def serve_assets(path):
# def command_daemon(cmd):
# def show_mementos_for_urirs_sans_js():
# def show_mementos_for_urirs(urir):
#     def __init__(self, url_map, *items):
# def resolve_memento(urir, datetime):
# def compile_target_uri(url: str, query_string: bytes) -> str:
# def show_memento(urir, datetime):
# def get_cdxj_line_closest_to(datetime_target, cdxj_lines):
# def get_cdxj_lines_with_urir(urir, index_path):
# def query_timegate(urir):
# def show_timemap(urir, timemap_format):
# def get_link_header_abbreviated_timemap(urir, pivot_datetime):
# def get_proxied_urit(uri_t):
# def generate_link_timemap_from_cdxj_lines(
#         cdxj_lines, original, tm_self, tg_uri):
# def generate_cdxj_timemap_from_cdxj_lines(
#         cdxj_lines, original, tm_self, tg_uri):
# def all_exception_handler(error):
# def show_admin():
# def show_landing_page():
# def show_uri(path, datetime=None):
#         def handler(signum, frame):
# def is_uri(str):
# def generate_no_mementos_interface_noDatetime(urir):
# def page_not_found(_):
# def generate_no_mementos_interface(path, datetime):
# def extract_response_from_chunked_data(data):
# def generate_daemon_status_button():
# def get_index_file_full_path(cdxj_file_path=INDEX_FILE):
# def get_uris_and_datetimes_in_cdxj(cdxj_file_path=INDEX_FILE):
# def calculate_memento_info_in_index(cdxj_file_path=INDEX_FILE):
# def objectify_cdxj_data(lines, only_uri):
# def binary_search(haystack, needle, return_index=False, only_uri=False):
# def get_cdxj_line_binary_search(
#          surt_uri, cdxj_file_path=INDEX_FILE, ret_index=False, only_uri=False):
# def start(cdxj_file_path, proxy=None):
# class UnsupportedIPFSVersions(Exception):
# class RegexConverter(BaseConverter):
#     class HashNotFoundError(Exception):


import pytest
import requests
import urllib
from . import testUtil as ipwb_test
from ipwb import replay
from time import sleep
    (True, 'https://www.example.com/foo?a=b&c=d'),
    (False, ''),
    (False, 'foo'),
    (False, 'foo/bar.baz'),
    (False, 'foo?a=b&c=d'),
    (False, '/'),
    (False, '/foo'),
    (False, '/foo/bar.baz'),
    (False, '/foo?a=b&c=d'),
    (False, './'),
    (False, './foo'),
    (False, './foo/bar.baz'),
    (False, './foo?a=b&c=d'),
    (False, '../'),
    (False, '../foo'),
    (False, '../foo/bar.baz'),
    (False, '../foo?a=b&c=d'),
    (False, '../../'),
    (False, '../../foo'),
    (False, '../../foo/bar.baz'),
    (False, '../../foo?a=b&c=d'),
    (False, 'ftp://example.com'),
    (False, 'httpd://example.com'),
    (False, 'http//example.com'),
    (False, 'http:/example.com'),
    (False, 'http:example.com'),
    (False, 'http.example.com'),
    (False, 'http-bin.com'),
])
def test_is_uri(expected, input):

# Path: ipwb/replay.py
# UPLOAD_FOLDER = tempfile.gettempdir()
# ALLOWED_EXTENSIONS = ('.warc', '.warc.gz')
# def formatters():
# def set_server_header(response):
# def allowed_file(filename):
# def upload_file():
# def serve_assets(path):
# def command_daemon(cmd):
# def show_mementos_for_urirs_sans_js():
# def show_mementos_for_urirs(urir):
#     def __init__(self, url_map, *items):
# def resolve_memento(urir, datetime):
# def compile_target_uri(url: str, query_string: bytes) -> str:
# def show_memento(urir, datetime):
# def get_cdxj_line_closest_to(datetime_target, cdxj_lines):
# def get_cdxj_lines_with_urir(urir, index_path):
# def query_timegate(urir):
# def show_timemap(urir, timemap_format):
# def get_link_header_abbreviated_timemap(urir, pivot_datetime):
# def get_proxied_urit(uri_t):
# def generate_link_timemap_from_cdxj_lines(
#         cdxj_lines, original, tm_self, tg_uri):
# def generate_cdxj_timemap_from_cdxj_lines(
#         cdxj_lines, original, tm_self, tg_uri):
# def all_exception_handler(error):
# def show_admin():
# def show_landing_page():
# def show_uri(path, datetime=None):
#         def handler(signum, frame):
# def is_uri(str):
# def generate_no_mementos_interface_noDatetime(urir):
# def page_not_found(_):
# def generate_no_mementos_interface(path, datetime):
# def extract_response_from_chunked_data(data):
# def generate_daemon_status_button():
# def get_index_file_full_path(cdxj_file_path=INDEX_FILE):
# def get_uris_and_datetimes_in_cdxj(cdxj_file_path=INDEX_FILE):
# def calculate_memento_info_in_index(cdxj_file_path=INDEX_FILE):
# def objectify_cdxj_data(lines, only_uri):
# def binary_search(haystack, needle, return_index=False, only_uri=False):
# def get_cdxj_line_binary_search(
#          surt_uri, cdxj_file_path=INDEX_FILE, ret_index=False, only_uri=False):
# def start(cdxj_file_path, proxy=None):
# class UnsupportedIPFSVersions(Exception):
# class RegexConverter(BaseConverter):
#     class HashNotFoundError(Exception):


# Path: tests/test_replay.py
import pytest
import requests
import urllib
from . import testUtil as ipwb_test
from ipwb import replay
from time import sleep

    (True, 'https://www.example.com/foo?a=b&c=d'),
    (False, ''),
    (False, 'foo'),
    (False, 'foo/bar.baz'),
    (False, 'foo?a=b&c=d'),
    (False, '/'),
    (False, '/foo'),
    (False, '/foo/bar.baz'),
    (False, '/foo?a=b&c=d'),
    (False, './'),
    (False, './foo'),
    (False, './foo/bar.baz'),
    (False, './foo?a=b&c=d'),
    (False, '../'),
    (False, '../foo'),
    (False, '../foo/bar.baz'),
    (False, '../foo?a=b&c=d'),
    (False, '../../'),
    (False, '../../foo'),
    (False, '../../foo/bar.baz'),
    (False, '../../foo?a=b&c=d'),
    (False, 'ftp://example.com'),
    (False, 'httpd://example.com'),
    (False, 'http//example.com'),
    (False, 'http:/example.com'),
    (False, 'http:example.com'),
    (False, 'http.example.com'),
    (False, 'http-bin.com'),
])
def test_is_uri(expected, input):

    assert expected == bool(replay.is_uri(input))