<commit_before>import argparse
import socket

READ_SIZE = 1024

def main():
    parser = argparse.ArgumentParser(description='Server for docker-transfer service')
    parser.add_argument('-H', '--host', nargs='?', default='localhost')
    parser.add_argument('-p', '--port', nargs='?', default=1208)
    parser.add_argument('filename', nargs='?', default='recieved')
    parser.add_argument('-v', '--verbose', action='store_true')
    parser.set_defaults(verbose=True)
    args = parser.parse_args()

    server = socket.socket()
    server.bind((args.host, args.port))
    server.listen(10)
    if args.verbose:
        print("Listening on {}:{}".format(args.host, args.port))
    i = 0


    try:
        while True:
            i += 1
            sc, address = server.accept()
            if args.verbose:
                print("Client connected: {}".format(address))
            line = sc.recv(READ_SIZE)
            handle = open(args.filename + str(i), 'wb')
            while line:
                print(line)
                if args.verbose:
                    print("Recieved {} bytes".format(READ_SIZE))
                handle.write(line)
                line = sc.recv(READ_SIZE)

            handle.close()
            sc.close()
            if args.verbose:
                print("Client disconnected: {}".format(address))

        server.close()
    finally:
        handle.close()
        sc.close()
        server.close()


if __name__ == "__main__":
    main()<commit_msg>bind to all addresses<commit_after>import argparse
import socket

READ_SIZE = 1024

def main():
    parser = argparse.ArgumentParser(description='Server for docker-transfer service')
    parser.add_argument('-H', '--host', nargs='?', default='0.0.0.0')
    parser.add_argument('-p', '--port', nargs='?', default=1208)
    parser.add_argument('filename', nargs='?', default='recieved')
    parser.add_argument('-v', '--verbose', action='store_true')
    parser.set_defaults(verbose=True)
    args = parser.parse_args()

    server = socket.socket()
    server.bind((args.host, args.port))
    server.listen(10)
    if args.verbose:
        print("Listening on {}:{}".format(args.host, args.port))
    i = 0


    try:
        while True:
            i += 1
            sc, address = server.accept()
            if args.verbose:
                print("Client connected: {}".format(address))
            line = sc.recv(READ_SIZE)
            handle = open(args.filename + str(i), 'wb')
            j = 0
            while line:
                j += 1
                if args.verbose:
                    print("Recieved {} bytes\r".format(READ_SIZE * j), end="")
                handle.write(line)
                line = sc.recv(READ_SIZE)

            handle.close()
            sc.close()
            if args.verbose:
                print("Client disconnected: {}".format(address))

        server.close()
    finally:
        handle.close()
        sc.close()
        server.close()


if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.14736143378692335, 'fraction_numerical': 0.009956853634251576, 'mean_word_length': 2.0261044176706826, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3243346', 'n_tokens_mistral': 917, 'n_tokens_neox': 870, 'n_words': 183}