input: Write a function to convert the given SQL query into a Python program. The function should establish a connection to the database, execute the SQL query with a parameter for the year, and output the results. If the input SQL query is empty, return an empty list.
  def sql_to_python(sql_query, year):
      import datetime, pyodbc
  
      # Establish a connection to the database
      conn = pyodbc.connect("<connection details>")
      cursor = conn.cursor()
  
      # Get the year of the order date
      where_clause = "WHERE YEAR(order_date) = ?"
  
      # Execute the query
      cursor.execute(sql_query + " " + where_clause, year)
      results = cursor.fetchall()
  
      # Output the results
      for result in results:
          print(result)
      return results
  
  assert sql_to_python("SELECT * FROM orders", 2020) == [('Order details 1', '2020-01-15'), ('Order details 2', '2020-03-22')]
  assert sql_to_python("SELECT * FROM orders", 2021) == [('Order details 3', '2021-12-01')]
  assert sql_to_python("", 2020) == []
output: def sql_to_python(sql_query, year):
      import pyodbc
  
      if not sql_query:
          return []
  
      conn = pyodbc.connect("<connection details>")
      cursor = conn.cursor()
  
      where_clause = "WHERE YEAR(order_date) = ?"
  
      cursor.execute(sql_query + " " + where_clause, year)
      results = cursor.fetchall()
  
      return results