# Path: sshuttle/helpers.py
# def debug2(s):
#     if verbose >= 2:
#         log(s)
# 
# def which(file, mode=os.F_OK | os.X_OK):
#     """A wrapper around shutil.which() that searches a predictable set of
#     paths and is more verbose about what is happening. See get_path()
#     for more information.
#     """
#     path = get_path()
#     rv = _which(file, mode, path)
#     if rv:
#         debug2("which() found '%s' at %s" % (file, rv))
#     else:
#         debug2("which() could not find '%s' in %s" % (file, path))
#     return rv
# 
# def get_path():
#     """Returns a string of paths separated by os.pathsep.
# 
#     Users might not have all of the programs sshuttle needs in their
#     PATH variable (i.e., some programs might be in /sbin). Use PATH
#     and a hardcoded set of paths to search through. This function is
#     used by our which() and get_env() functions. If which() and the
#     subprocess environments differ, programs that which() finds might
#     not be found at run time (or vice versa).
#     """
#     path = []
#     if "PATH" in os.environ:
#         path += os.environ["PATH"].split(os.pathsep)
#     # Python default paths.
#     path += os.defpath.split(os.pathsep)
#     # /sbin, etc are not in os.defpath and may not be in PATH either.
#     # /bin/ and /usr/bin below are probably redundant.
#     path += ['/bin', '/usr/bin', '/sbin', '/usr/sbin']
# 
#     # Remove duplicates. Not strictly necessary.
#     path_dedup = []
#     for i in path:
#         if i not in path_dedup:
#             path_dedup.append(i)
# 
#     return os.pathsep.join(path_dedup)
# 
# class Fatal(Exception):
#     pass


import sys
import os
import re
import socket
import zlib
import importlib
import importlib.util
import subprocess as ssubprocess
import shlex
import ipaddress
import sshuttle.helpers as helpers
from shlex import quote
from urllib.parse import urlparse
from sshuttle.helpers import debug2, which, get_path, Fatal



def get_module_source(name):
    spec = importlib.util.find_spec(name)
    with open(spec.origin, "rt") as f:
        return f.read().encode("utf-8")


def empackage(z, name, data=None):

# Path: sshuttle/helpers.py
# def debug2(s):
#     if verbose >= 2:
#         log(s)
# 
# def which(file, mode=os.F_OK | os.X_OK):
#     """A wrapper around shutil.which() that searches a predictable set of
#     paths and is more verbose about what is happening. See get_path()
#     for more information.
#     """
#     path = get_path()
#     rv = _which(file, mode, path)
#     if rv:
#         debug2("which() found '%s' at %s" % (file, rv))
#     else:
#         debug2("which() could not find '%s' in %s" % (file, path))
#     return rv
# 
# def get_path():
#     """Returns a string of paths separated by os.pathsep.
# 
#     Users might not have all of the programs sshuttle needs in their
#     PATH variable (i.e., some programs might be in /sbin). Use PATH
#     and a hardcoded set of paths to search through. This function is
#     used by our which() and get_env() functions. If which() and the
#     subprocess environments differ, programs that which() finds might
#     not be found at run time (or vice versa).
#     """
#     path = []
#     if "PATH" in os.environ:
#         path += os.environ["PATH"].split(os.pathsep)
#     # Python default paths.
#     path += os.defpath.split(os.pathsep)
#     # /sbin, etc are not in os.defpath and may not be in PATH either.
#     # /bin/ and /usr/bin below are probably redundant.
#     path += ['/bin', '/usr/bin', '/sbin', '/usr/sbin']
# 
#     # Remove duplicates. Not strictly necessary.
#     path_dedup = []
#     for i in path:
#         if i not in path_dedup:
#             path_dedup.append(i)
# 
#     return os.pathsep.join(path_dedup)
# 
# class Fatal(Exception):
#     pass


# Path: sshuttle/ssh.py
import sys
import os
import re
import socket
import zlib
import importlib
import importlib.util
import subprocess as ssubprocess
import shlex
import ipaddress
import sshuttle.helpers as helpers
from shlex import quote
from urllib.parse import urlparse
from sshuttle.helpers import debug2, which, get_path, Fatal




def get_module_source(name):
    spec = importlib.util.find_spec(name)
    with open(spec.origin, "rt") as f:
        return f.read().encode("utf-8")


def empackage(z, name, data=None):

    if not data: