input: Write a function to create a Deep Learning Program in Python that predicts stock prices using an LSTM model. The function should read data from a CSV file, preprocess the data, build and compile the model, and finally train the model. The function should return the trained model.
  assert create_stock_predictor("data.csv").model.name=="sequential"
  assert create_stock_predictor("data.csv").layers[0].units==50
  assert create_stock_predictor("invalid.csv")==None
output: def create_stock_predictor(file_path):
      try:
          import pandas as pd
          from sklearn.preprocessing import MinMaxScaler
          from tensorflow.keras.models import Sequential
          from tensorflow.keras.layers import LSTM, Dense
  
          data = pd.read_csv(file_path)
          scaler = MinMaxScaler(feature_range=(0, 1))
          scaled_data = scaler.fit_transform(data[['Close']])
  
          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))
  
          model = Sequential()
          model.add(LSTM(units=50, return_sequences=True, input_shape=(X.shape[1], 1)))
          model.add(LSTM(units=50, return_sequences=False))
          model.add(Dense(units=25))
          model.add(Dense(units=1))
  
          model.compile(optimizer='adam', loss='mean_squared_error')
          model.fit(X, y, batch_size=1, epochs=1)
  
          return model
      except:
          return None