input: Write a python function to train a linear regression model and calculate the R2 score on a given dataset.
  assert isinstance(train_and_evaluate_linear_regression('auto.csv'), float)
  assert 0 <= train_and_evaluate_linear_regression('auto.csv') <= 1
output: def train_and_evaluate_linear_regression(file_path):
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LinearRegression
      from sklearn.metrics import r2_score
  
      # Load dataset
      data = pd.read_csv(file_path)
  
      # Assuming the target column is named 'target' and features are all other columns
      X = data.drop(columns='target')
      y = data['target']
  
      # Split the dataset 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)
  
      # Predict on the test set
      y_pred = model.predict(X_test)
  
      # Calculate the R2 score
      r2 = r2_score(y_test, y_pred)
  
      return r2