input: Write a function to implement a decision tree algorithm for predicting the value of a stock based on historical stock data provided in a CSV file. The function should split the data into training and testing sets, train the decision tree model, and then return the accuracy of the model on the test set.
  assert decision_tree_stock_predictor("stockdata1.csv") == 0.75
  assert decision_tree_stock_predictor("stockdata2.csv") == 0.83
  assert decision_tree_stock_predictor("stockdata3.csv") == 0.79
  assert decision_tree_stock_predictor("emptyfile.csv") == "Error: File is empty or invalid"
output: def decision_tree_stock_predictor(csv_file):
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.tree import DecisionTreeClassifier
      from sklearn.metrics import accuracy_score
  
      try:
          data = pd.read_csv(csv_file)
          if data.empty:
              return "Error: File is empty or invalid"
          
          X = data.iloc[:, :-1]
          y = data.iloc[:, -1]
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
          
          model = DecisionTreeClassifier()
          model.fit(X_train, y_train)
          
          y_pred = model.predict(X_test)
          accuracy = accuracy_score(y_test, y_pred)
          
          return round(accuracy, 2)
      except Exception:
          return "Error: File is empty or invalid"