input: Write a function that implements a simple linear regression model in Python. The function should read data from a CSV file, train a linear regression model, make predictions, and visualize the results using a scatter plot with the regression line. If the CSV file is not found or if the data columns 'X' and 'Y' are missing, the function should print an appropriate error message.
  assert linear_regression_model('data.csv')==None
  assert linear_regression_model('nonexistent.csv')=="CSV file not found."
  assert linear_regression_model('data_missing_columns.csv')=="Data columns 'X' or 'Y' are missing."
output: import pandas as pd
  import matplotlib.pyplot as plt
  from sklearn.linear_model import LinearRegression
  
  def linear_regression_model(filename):
      try:
          data = pd.read_csv(filename)
      except FileNotFoundError:
          print("CSV file not found.")
          return "CSV file not found."
      
      if 'X' not in data.columns or 'Y' not in data.columns:
          print("Data columns 'X' or 'Y' are missing.")
          return "Data columns 'X' or 'Y' are missing."
      
      X = data[['X']]
      Y = data['Y']
      
      model = LinearRegression()
      model.fit(X, Y)
      
      predictions = model.predict(X)
      
      plt.scatter(X, Y, color='blue')
      plt.plot(X, predictions, color='red')
      plt.xlabel('X')
      plt.ylabel('Y')
      plt.title('Linear Regression')
      plt.show()