packet_sizes = params.get("packet_size", "").split()
Will get the same results and we can save one line in the code.