input: Write a function to re-write a given SQL query in Python. The function should take the SQL query as input and return the corresponding Python code.
  assert rewrite_sql_to_python("SELECT * FROM Movies WHERE category = 'horror'") == "import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"SELECT * FROM Movies WHERE category = 'horror')\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"
  assert rewrite_sql_to_python("SELECT name, genre FROM Films WHERE year > 2000") == "import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"SELECT name, genre FROM Films WHERE year > 2000\")\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"
  assert rewrite_sql_to_python("SELECT title, rating FROM TVShows WHERE rating >= 8.0") == "import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"SELECT title, rating FROM TVShows WHERE rating >= 8.0\")\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"
output: def rewrite_sql_to_python(sql_query):
      return f"import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"{sql_query}\")\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"