input: Write a python function to train a Linear Regression model on stock data and return the mean squared error of the predictions.
  assert round(train_and_evaluate_model('stock_data.csv'), 2) == 12.34  # Example value, replace with actual expected value
  assert isinstance(train_and_evaluate_model('stock_data.csv'), float)
output: def train_and_evaluate_model(filename):
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LinearRegression
      from sklearn.metrics import mean_squared_error
  
      # Load data
      data = pd.read_csv(filename)
  
      # Assume the target variable is named 'price' and features are all other columns
      X = data.drop('price', axis=1)
      y = data['price']
  
      # Split the data into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Train the model
      model = LinearRegression()
      model.fit(X_train, y_train)
  
      # Make predictions
      predictions = model.predict(X_test)
  
      # Calculate the mean squared error
      mse = mean_squared_error(y_test, predictions)
  
      return mse