input: Write a function to convert a SQL query into a Python program. The function should take a SQL query string as input and return a Python program string that executes the SQL query. If the SQL query contains a WHERE clause with the YEAR function, the function should dynamically adjust the year to be the current year.
  
  def sql_to_python(sql_query):
      import datetime
      import pyodbc
      
      # Establish a connection to the database
      conn = pyodbc.connect("<connection details>")
      cursor = conn.cursor()
      
      # Check if the SQL query contains a WHERE clause with the YEAR function
      if "YEAR" in sql_query:
          query_date = datetime.date.today().year
          where_clause = sql_query.split("WHERE")[1].strip().replace("2020", "?")
          sql_query = sql_query.split("WHERE")[0].strip() + " WHERE " + where_clause
          
          # Execute the query
          cursor.execute(sql_query, query_date)
      else:
          cursor.execute(sql_query)
          
      results = cursor.fetchall()
      
      # Create a string of the Python program
      python_program = f"""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 = "{sql_query.split(" WHERE ")[0]}"
  query_date = datetime.date.today().year
  where_clause = "{where_clause if 'YEAR' in sql_query else ''}"
  
  # Execute the query
  cursor.execute(sql + " " + where_clause, query_date)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)"""
      
      return python_program
  
  assert 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)""".strip()
  
  assert sql_to_python("SELECT * FROM orders") == """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 = ""
  
  # Execute the query
  cursor.execute(sql + " " + where_clause)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)""".strip()
output: def sql_to_python(sql_query):
      import datetime
      import pyodbc
      
      # Establish a connection to the database
      conn = pyodbc.connect("<connection details>")
      cursor = conn.cursor()
      
      # Check if the SQL query contains a WHERE clause with the YEAR function
      if "YEAR" in sql_query:
          query_date = datetime.date.today().year
          where_clause = sql_query.split("WHERE")[1].strip().replace("2020", "?")
          sql_query = sql_query.split("WHERE")[0].strip() + " WHERE " + where_clause
          
          # Execute the query
          cursor.execute(sql_query, query_date)
      else:
          cursor.execute(sql_query)
          
      results = cursor.fetchall()
      
      # Create a string of the Python program
      python_program = f"""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 = "{sql_query.split(" WHERE ")[0]}"
  query_date = datetime.date.today().year
  where_clause = "{where_clause if 'YEAR' in sql_query else ''}"
  
  # Execute the query
  cursor.execute(sql + " " + where_clause, query_date)
  results = cursor.fetchall()
  
  # Output the results
  for result in results:
      print(result)"""
      
      return python_program