input: Write a function to rewrite the provided JavaScript code in Python. The function should read an array, multiply each item by 2, and print the result. If the input array is empty, it should print nothing. The function should return nothing.
  assert rewrite_code([1, 2, 3, 4, 5])==None
  assert rewrite_code([])==None
output: def rewrite_code(arr):
      if arr:
          for item in arr:
              print(item * 2)