code: def titanic_embarked():
      d_train2 = d_train.copy()
      d_train2 = d_train2[d_train2.Embarked_Unknown == 0]
      X_train = d_train2.drop(
          [
              "Embarked_Cherbourg",
              "Embarked_Queenstown",
              "Embarked_Southampton",
              "Embarked_Unknown",
              "Name",
          ],
          axis=1,
      )
      X_train.index = d_train2.Name
      X_train.index.name = "Passenger"
  
      y_train = pd.Series(
          np.where(
              d_train2.Embarked_Queenstown == 1,
              0,
              np.where(
                  d_train2.Embarked_Southampton == 1,
                  1,
                  np.where(d_train2.Embarked_Cherbourg == 1, 2, 3),
              ),
          ),
          name="Embarked",
      )
      X_test = d_test.drop(
          [
              "Embarked_Cherbourg",
              "Embarked_Queenstown",
              "Embarked_Southampton",
              "Embarked_Unknown",
              "Name",
          ],
          axis=1,
      )
      X_test.index = d_test.Name
      X_test.index.name = "Passenger"
      y_test = pd.Series(
          np.where(
              d_test.Embarked_Queenstown == 1,
              0,
              np.where(
                  d_test.Embarked_Southampton == 1,
                  1,
                  np.where(d_test.Embarked_Cherbourg == 1, 2, 3),
              ),
          ),
          name="Embarked",
      )
      return X_train, y_train, X_test, y_test
  
imports: import numpy
  import pandas
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: titanic_embarked() and returns: X_train,  y_train,  X_test,  y_test