input: Write a python function to train a Naive Bayes classifier on a given dataset and return its accuracy.
  assert train_naive_bayes("dataset.csv") > 0.7
  assert train_naive_bayes("another_dataset.csv") > 0.6
  assert train_naive_bayes("third_dataset.csv") == 0.75
output: def train_naive_bayes(csv_file):
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.naive_bayes import GaussianNB
      from sklearn.metrics import accuracy_score
  
      # Load dataset
      data = pd.read_csv(csv_file)
  
      # Assuming the last column is the target variable
      X = data.iloc[:, :-1].values
      y = data.iloc[:, -1].values
  
      # 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 Naive Bayes classifier
      model = GaussianNB()
      model.fit(X_train, y_train)
  
      # Predict on the test set
      y_pred = model.predict(X_test)
  
      # Calculate accuracy
      accuracy = accuracy_score(y_test, y_pred)
  
      return accuracy