input: Write a function to rewrite the given SQL query in Python. The function should take the SQL query as input and return the equivalent Python code.
  assert rewrite_sql_query("SELECT * FROM Movies WHERE category = 'horror'") == '''import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()'''
  
  assert rewrite_sql_query(None) == None
output: def rewrite_sql_query(sql_query):
      if sql_query is None:
          return None
      return f'''import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("{sql_query}")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()'''