input: Write a function to create a Deep Learning model in Python using Keras to predict stock prices based on historical data. The model should be a sequential model with LSTM layers and Dropout for regularization. It should read the data from a CSV file, split it into training and testing sets, and then train the model using the training data. The function should return the trained model.
  
  assert create_stock_prediction_model()!=None
  assert create_stock_prediction_model().history.epoch[-1]==49
  assert create_stock_prediction_model().history.params['batch_size']==32
  assert create_stock_prediction_model().history.params['epochs']==50
output: def create_stock_prediction_model():
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.preprocessing import MinMaxScaler
      from keras.models import Sequential
      from keras.layers import LSTM, Dense, Dropout
  
      # Load data
      data = pd.read_csv('stock_prices.csv')
      data = data.dropna()
      scaler = MinMaxScaler(feature_range=(0, 1))
      scaled_data = scaler.fit_transform(data['Close'].values.reshape(-1, 1))
  
      # Prepare data
      X = []
      y = []
      for i in range(60, len(scaled_data)):
          X.append(scaled_data[i-60:i, 0])
          y.append(scaled_data[i, 0])
      X, y = np.array(X), np.array(y)
      X = np.reshape(X, (X.shape[0], X.shape[1], 1))
  
      # Split data
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Build model
      model = Sequential()
      model.add(LSTM(units=50, return_sequences=True, input_shape=(X_train.shape[1], 1)))
      model.add(Dropout(0.2))
      model.add(LSTM(units=50, return_sequences=False))
      model.add(Dropout(0.2))
      model.add(Dense(units=25))
      model.add(Dense(units=1))
  
      model.compile(optimizer='adam', loss='mean_squared_error')
      model.fit(X_train, y_train, batch_size=32, epochs=50)
  
      return model