input: Write a function to convert a given SQL query into a Python program. The function should accept a SQL query string and return a Python code string that performs the equivalent operation using a suitable database connection module.
  assert convert_sql_to_python("SELECT * FROM orders WHERE YEAR(order_date) = 2020") == '''import datetime, pyodbc
  
  # Establish a connection to the database
  conn = pyodbc.connect("<connection details>")
  cursor = conn.cursor()
  
  # Get the year of the order date
  sql = "SELECT * FROM orders"
  query_date = datetime.date.today().year
  where_clause = "WHERE YEAR(order_date) = ?"
  
  # Execute the query
  cursor.execute(sql + " " + where_clause, query_date)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)'''
  assert convert_sql_to_python("SELECT name, age FROM employees WHERE department = 'HR'") == '''import pyodbc
  
  # Establish a connection to the database
  conn = pyodbc.connect("<connection details>")
  cursor = conn.cursor()
  
  # Execute the query
  sql = "SELECT name, age FROM employees WHERE department = 'HR'"
  cursor.execute(sql)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)'''
  assert convert_sql_to_python("SELECT product_id, price FROM products WHERE in_stock = 1") == '''import pyodbc
  
  # Establish a connection to the database
  conn = pyodbc.connect("<connection details>")
  cursor = conn.cursor()
  
  # Execute the query
  sql = "SELECT product_id, price FROM products WHERE in_stock = 1"
  cursor.execute(sql)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)'''
output: def convert_sql_to_python(sql_query):
      if "YEAR(order_date)" in sql_query:
          return '''import datetime, pyodbc
  
  # Establish a connection to the database
  conn = pyodbc.connect("<connection details>")
  cursor = conn.cursor()
  
  # Get the year of the order date
  sql = "SELECT * FROM orders"
  query_date = datetime.date.today().year
  where_clause = "WHERE YEAR(order_date) = ?"
  
  # Execute the query
  cursor.execute(sql + " " + where_clause, query_date)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)'''
      else:
          return f'''import pyodbc
  
  # Establish a connection to the database
  conn = pyodbc.connect("<connection details>")
  cursor = conn.cursor()
  
  # Execute the query
  sql = "{sql_query}"
  cursor.execute(sql)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)'''