# Path: ss/settings.py
# class Settings(object):
#     DEFAULT_TIMEOUT = 300
#     _LOCK = RLock()
#     def __init__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def get(self, name, default=None):
#     def __contains__(self, name):
#     def update(self, config):
#     def dict(self):
#     def __repr__(self):


import platform
import argparse
import logging
import sys
import os
import json
        import re
from ss.settings import settings
        from multiprocessing import cpu_count
            p = os.path.join(basedir, p)
        return p

    def _check_rhost(self, r):
        try:
            h, p = r.split(":")
            if h.startswith("127") or \
                h == "0.0.0.0":
                logging.warn("make sure your remote host config `%s` is right" % r)
            return h, int(p)
        except Exception:
            raise argparse.ArgumentTypeError("invalid rhost value `%s`" % r)

    def _check_addr(self, addr):
        return to_bytes(addr)

    def _default_workers(self):
        if os.name != "posix":
            return 1
        else:
            return cpu_count()

    def _check_workers(self, c):
        try:
            c = int(c)
            if os.name != "posix" and c > 1:
                logging.warn("fork mode is only support on `posix`, "
                             "other platform worker count is limit 1")
                c = 1
            return c

# Path: ss/settings.py
# class Settings(object):
#     DEFAULT_TIMEOUT = 300
#     _LOCK = RLock()
#     def __init__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def get(self, name, default=None):
#     def __contains__(self, name):
#     def update(self, config):
#     def dict(self):
#     def __repr__(self):


# Path: ss/cli.py
import platform
import argparse
import logging
import sys
import os
import json
        import re
from ss.settings import settings
        from multiprocessing import cpu_count

            p = os.path.join(basedir, p)
        return p

    def _check_rhost(self, r):
        try:
            h, p = r.split(":")
            if h.startswith("127") or \
                h == "0.0.0.0":
                logging.warn("make sure your remote host config `%s` is right" % r)
            return h, int(p)
        except Exception:
            raise argparse.ArgumentTypeError("invalid rhost value `%s`" % r)

    def _check_addr(self, addr):
        return to_bytes(addr)

    def _default_workers(self):
        if os.name != "posix":
            return 1
        else:
            return cpu_count()

    def _check_workers(self, c):
        try:
            c = int(c)
            if os.name != "posix" and c > 1:
                logging.warn("fork mode is only support on `posix`, "
                             "other platform worker count is limit 1")
                c = 1
            return c

        except ValueError: