input: Write a function to rewrite the given JavaScript code in Python. The function should take a JavaScript code snippet as input and return the corresponding Python code snippet. If the input is invalid or cannot be translated, return an error message.
  
  assert translate_js_to_python("let arr = [1, 2, 3, 4, 5];\n\narr.forEach(item => {\n console.log(item * 2);\n});") == "arr = [1, 2, 3, 4, 5]\n\nfor item in arr:\n print(item * 2)"
  assert translate_js_to_python("let arr = [10, 20, 30];\n\narr.forEach(item => {\n console.log(item / 2);\n});") == "arr = [10, 20, 30]\n\nfor item in arr:\n print(item / 2)"
  assert translate_js_to_python("let arr = [1, 2, 3];\n\narr.forEach(item => {\n console.log(item + 5);\n});") == "arr = [1, 2, 3]\n\nfor item in arr:\n print(item + 5)"
  assert translate_js_to_python("let arr = [];\n\narr.forEach(item => {\n console.log(item * 2);\n});") == "arr = []\n\nfor item in arr:\n print(item * 2)"
  assert translate_js_to_python("") == "Error: Invalid input or cannot be translated"
output: def translate_js_to_python(js_code):
      if not js_code.strip():
          return "Error: Invalid input or cannot be translated"
      
      try:
          lines = js_code.split('\n')
          arr_line = lines[0]
          arr_match = re.match(r'let\s+arr\s*=\s*\[(.*?)\];', arr_line)
          if not arr_match:
              return "Error: Invalid input or cannot be translated"
          
          arr_values = arr_match.group(1)
          python_arr = f"arr = [{arr_values}]"
          
          forEach_line = lines[2]
          forEach_match = re.match(r'arr\.forEach\(item\s*=>\s*{\s*console\.log\((.*?)\);\s*}\);', forEach_line)
          if not forEach_match:
              return "Error: Invalid input or cannot be translated"
          
          operation = forEach_match.group(1)
          python_for_loop = f"for item in arr:\n print({operation})"
          
          return f"{python_arr}\n\n{python_for_loop}"
      except:
          return "Error: Invalid input or cannot be translated"