def main(args=None):
    from wsgiref import simple_server
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--lookup', default='http://teta.local:8080',
        help='lookup service url')
    parser.add_argument(
        '-p', '--port', default=8090, type=int,
        help='the port i am listening on for communication')
    parser.add_argument("myid", help="id to connect as")
    parser.add_argument("otherid", help="id to connect to", default=None, nargs="?")
    if args is None:
        args = sys.argv[1:]
    args = parser.parse_args()
    my_hostname = subprocess.check_output("hostname").strip()
    if not my_hostname.endswith(".local"):
        my_hostname += ".local"
    my_url = "http://%s:%s"% (my_hostname, args.port)
    lookup = LookupService(args.lookup)
    uithread = InputThread(args.myid, lookup)
    uithread.setDaemon(True)
    if args.otherid is not None:
        uithread.add_id(args.otherid)
    uithread.start()
    app = ReceiveApp(uithread)
    server = simple_server.make_server(my_hostname, args.port, app)
    print ((my_hostname, args.port) % 'Serving on http://%s:%s')
    lookup.announce_presence(args.myid, my_url)
    server.serve_forever()
dataset/ETHPy150Open hpk42/p4p/attic/friend_client.py/main/swapped operands of `%`