input: Write a python function to train a RandomForestClassifier on a dataset and evaluate its accuracy.
  assert train_and_evaluate_model(x, y) >= 0.7
  assert train_and_evaluate_model(x, y) <= 1.0
output: def train_and_evaluate_model(x, y):
      from sklearn.ensemble import RandomForestClassifier
      from sklearn.model_selection import train_test_split
      from sklearn.metrics import accuracy_score
      
      # Split the data into train and test sets
      x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=42)
      
      # Initialize the RandomForestClassifier
      clf = RandomForestClassifier(random_state=42)
      
      # Train the model
      clf.fit(x_train, y_train)
      
      # Predict the labels on the test set
      y_pred = clf.predict(x_test)
      
      # Calculate the accuracy
      accuracy = accuracy_score(y_test, y_pred)
      
      return accuracy