def main(): params = parse_arguments() directory, port, size = (params.get('directory'), params.get('port'), params.get('size')) ss.ForkingTCPServer.allow_reuse_address = True server = ss.ThreadingTCPServer(("0.0.0.0", port), Handler) server_thread = threading.Thread(target=server.serve_forever) server_thread.start()
def main(): n, dist, params = parse_arguments() # random seed seed = time.time() random.seed(seed) try: generator = getattr(sample_generators, f"generate_{dist}_samples") samples = generator(n, params) except KeyError: abort("distribution not recognized") print_report(samples)
async def main(): params = parse_arguments() directory, port, size= ( params.get('directory'), params.get('port'), params.get('size') ) dir = directory+"/" server = await asyncio.start_server( lambda reader,address: handler(reader,address,dir,size), ('::','0.0.0.0'),port ) async with server: await server.serve_forever()
def main(): params = parse_arguments() path = params.get('carrier_path') image = process_image(path, 100) header = get_header(image) offset, interleave, l_total, cipher = (header.get('offset'), header.get('interleave'), header.get('l_total'), header.get('cipher')) print( extract_message(path, int(l_total), int(offset), int(interleave), cipher))
def main(): params = parse_arguments() block_size, path, message, offset, interleave, output, cipher = ( int(params.get('block_size')), params.get('carrier_path'), params.get('message'), params.get('pixels_offset', 0), params.get('pixels_interleave', 0), params.get('output_file'), params.get('cipher')) validate_params(path, message, block_size, offset, interleave) image = process_image(path, block_size) header = get_header(image) raster = get_raster(image) message = get_message(message) raster = rgb_threads(raster, message, offset, interleave, cipher) write_image(header, raster, output, offset, interleave, message, cipher) finish = perf_counter() tt = round(finish - start, 3) print("Total time: ", tt)