input: Write a function to rewrite the given JavaScript code in Python.
  assert rewrite_code([1, 2, 3, 4, 5])=="""arr = [1, 2, 3, 4, 5]\n\nfor item in arr:\n print(item * 2)"""
  assert rewrite_code([6, 7, 8, 9, 10])=="""arr = [6, 7, 8, 9, 10]\n\nfor item in arr:\n print(item * 2)"""
  assert rewrite_code([])=="""arr = []\n\nfor item in arr:\n print(item * 2)"""
  assert rewrite_code([2, 4, 6, 8, 10])=="""arr = [2, 4, 6, 8, 10]\n\nfor item in arr:\n print(item * 2)"""
  assert rewrite_code([3, 2, 1])=="""arr = [3, 2, 1]\n\nfor item in arr:\n print(item * 2)"""
output: def rewrite_code(arr):
      return f"arr = {arr}\n\nfor item in arr:\n print(item * 2)"