input: Write a python function to train and evaluate a RandomForestClassifier on a given dataset.
  assert train_and_evaluate_rf(pd.DataFrame({'size': [1, 2, 3], 'color': [1, 2, 3], 'behavior': [1, 2, 3]}), pd.Series([0, 1, 0])) >= 0
  assert train_and_evaluate_rf(pd.DataFrame({'size': [1, 2, 1, 2], 'color': [1, 1, 2, 2], 'behavior': [1, 2, 1, 2]}), pd.Series([0, 0, 1, 1])) >= 0
  assert train_and_evaluate_rf(pd.DataFrame({'size': [1, 2], 'color': [1, 2], 'behavior': [1, 2]}), pd.Series([0, 1])) >= 0
output: def train_and_evaluate_rf(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 training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
      
      # Create a RandomForestClassifier instance
      clf = RandomForestClassifier(random_state=42)
      
      # Train the classifier
      clf.fit(X_train, y_train)
      
      # Make predictions
      y_pred = clf.predict(X_test)
      
      # Calculate and return accuracy
      return accuracy_score(y_test, y_pred)