input: Write a function to create a Python script that prepares data and trains a model for a Kaggle competition. The function should read a CSV file, split the data into training and testing sets, train a model, make predictions, and calculate the accuracy score. If no CSV file is provided, the function should return an appropriate message.
  
  assert kaggle_competition(None)=='No CSV file provided'
  assert kaggle_competition('data.csv')=='Model trained and accuracy calculated'
output: def kaggle_competition(csv_file):
      if csv_file is None:
          return 'No CSV file provided'
      
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.ensemble import RandomForestClassifier
      from sklearn.metrics import accuracy_score
  
      data = pd.read_csv(csv_file)
      X = data.drop('target', axis=1)
      y = data['target']
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      model = RandomForestClassifier()
      model.fit(X_train, y_train)
      y_pred = model.predict(X_test)
      
      accuracy = accuracy_score(y_test, y_pred)
      return 'Model trained and accuracy calculated'