input: Write a python function to train a linear regression model and calculate the RMSE.
  assert np.isclose(train_and_evaluate_model(X, y), 29405.779, rtol=1e-2)
  assert np.isclose(train_and_evaluate_model(X.sample(frac=0.8, random_state=1), y.sample(frac=0.8, random_state=1)), 29500.123, rtol=1e-2)
output: def train_and_evaluate_model(X, y):
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LinearRegression
      from sklearn.metrics import mean_squared_error
      import numpy as np
  
      # 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 linear regression model
      model = LinearRegression()
      model.fit(X_train, y_train)
  
      # Make predictions on the test set
      y_pred = model.predict(X_test)
  
      # Calculate the RMSE
      rmse = np.sqrt(mean_squared_error(y_test, y_pred))
  
      return rmse