def main():
    global remote_host, remote_port, remote_ssl
    msg.LOG_LEVEL = msg.LOG_LEVELS['ERROR']

    usage = 'Figure it out :P'
    parser = optparse.OptionParser(usage=usage)
    parser.add_option(
        '--url',
        dest='url',
        default=None
    )
    parser.add_option(
        '--data',
        dest='data',
        default=None
    )
    parser.add_option(
        '--method',
        dest='method',
        default=None
    )
    parser.add_option(
        '--host',
        dest='host',
        default=None
    )
    parser.add_option(
        '--port',
        dest='port',
        default=None
    )
    parser.add_option(
        '--ssl',
        dest='ssl',
        default=None
    )

    options, args = parser.parse_args()

    if options.url:
        data = None
        err = False
        if options.data:
            data = json.loads(options.data)
        try:
            r = api.hit_url(options.host, options.url, data, options.method)
        except HTTPError as e:
            r = e
        except URLError as e:
            r = e
            err = True

        try:
            print(r.code)
        except Exception:
            err = True
        if err:
            print(r.reason)
        else:
            print(r.read().decode('utf-8'))
        sys.exit(err)

    if not options.host:
        sys.exit(1)

    remote_host = options.host
    remote_port = int(options.port) or remote_port
    remote_ssl = bool(options.ssl) or remote_ssl

    proxy = Server()
    _, port = reactor.reactor.listen(proxy, port=int(G.PROXY_PORT))

    def on_ready():
        print(port % 'Now listening on <%s>')
        sys.stdout.flush()

    utils.set_timeout(on_ready, 100)

    try:
        reactor.reactor.block()
    except KeyboardInterrupt:
        print('ciao')
dataset/ETHPy150Open Floobits/floobits-sublime/floo/proxy.py/main/swapped operands of `%`