{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport random\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom itertools import groupby\nimport gc\n\nfrom sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler\n\nnp.random.seed(0)\npd.set_option('display.precision', 2)  \npd.set_option('display.float_format', '{:.2f}'.format) ","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-09-27T09:08:31.215898Z","iopub.execute_input":"2023-09-27T09:08:31.216469Z","iopub.status.idle":"2023-09-27T09:08:33.367015Z","shell.execute_reply.started":"2023-09-27T09:08:31.216435Z","shell.execute_reply":"2023-09-27T09:08:33.365920Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Find Train Series","metadata":{}},{"cell_type":"code","source":"train_events = pd.read_csv(\"/kaggle/input/child-mind-institute-detect-sleep-states/train_events.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:33.368996Z","iopub.execute_input":"2023-09-27T09:08:33.369404Z","iopub.status.idle":"2023-09-27T09:08:33.398202Z","shell.execute_reply.started":"2023-09-27T09:08:33.369369Z","shell.execute_reply":"2023-09-27T09:08:33.397281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"series_has_nan = train_events.groupby('series_id')['step'].apply(lambda x: x.isnull().any())\ntrain_ids = series_has_nan[~series_has_nan].index.tolist()","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:33.399668Z","iopub.execute_input":"2023-09-27T09:08:33.400057Z","iopub.status.idle":"2023-09-27T09:08:33.446340Z","shell.execute_reply.started":"2023-09-27T09:08:33.400021Z","shell.execute_reply":"2023-09-27T09:08:33.445493Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Feature Engineering","metadata":{"execution":{"iopub.status.busy":"2023-09-11T07:51:53.848944Z","iopub.execute_input":"2023-09-11T07:51:53.849322Z","iopub.status.idle":"2023-09-11T07:51:53.854508Z","shell.execute_reply.started":"2023-09-11T07:51:53.849292Z","shell.execute_reply":"2023-09-11T07:51:53.853330Z"}}},{"cell_type":"code","source":"def get_multi_light_series(series_ids):\n    print(f'fetch {series_ids} \\n')\n    multi_series = pd.read_parquet(\"/kaggle/input/zzzs-lightweight-training-dataset-target/Zzzs_train.parquet\", filters=[('series_id','in',series_ids)])\n    multi_series = multi_series.astype({'series_id':'category','step':'int16','awake': 'int16'})\n    multi_series =  add_features(multi_series)\n    return multi_series\n\n\ndef add_features(df):\n    df[\"timestamp\"] = pd.to_datetime(df[\"timestamp\"],utc=True)\n    df[\"hour\"] = df[\"timestamp\"].dt.hour\n    df[\"dayofweek\"] = df[\"timestamp\"].dt.dayofweek\n\n    df[\"anglez_times_enmo\"] = abs(df[\"anglez\"]) * df[\"enmo\"]\n\n    periods = 6 # 1/2 minute\n    df[\"anglez_diff\"] = df.groupby('series_id')['anglez'].diff(periods=periods).fillna(method=\"bfill\")\n    df[\"enmo_diff\"]   = df.groupby('series_id')['enmo'].diff(periods=periods).fillna(method=\"bfill\")\n    \n    df[\"anglez_mean\"] = df[\"anglez\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    df[\"enmo_mean\"]   = df[\"enmo\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    \n    df[\"anglez_min\"] = df[\"anglez\"].rolling(periods,center=True).min().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    df[\"enmo_min\"]   = df[\"enmo\"].rolling(periods,center=True).min().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    \n    df[\"anglez_max\"] = df[\"anglez\"].rolling(periods,center=True).max().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    df[\"enmo_max\"]   = df[\"enmo\"].rolling(periods,center=True).max().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    \n    df[\"anglez_std\"] = df[\"anglez\"].rolling(periods,center=True).std().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    df[\"enmo_std\"]   = df[\"enmo\"].rolling(periods,center=True).std().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    \n    df[\"anglez_diff_rolling\"] = df[\"anglez_diff\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    df[\"enmo_diff_rolling\"]   = df[\"enmo_diff\"].rolling(periods,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\").astype('float32')\n    return df","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:33.449099Z","iopub.execute_input":"2023-09-27T09:08:33.449463Z","iopub.status.idle":"2023-09-27T09:08:33.464629Z","shell.execute_reply.started":"2023-09-27T09:08:33.449429Z","shell.execute_reply":"2023-09-27T09:08:33.463615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%time train_all = get_multi_light_series(train_ids[:8])\nprint(f'memory usage: {train_all.memory_usage().sum() / 1024**2: .2f} MB')","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:33.465857Z","iopub.execute_input":"2023-09-27T09:08:33.466801Z","iopub.status.idle":"2023-09-27T09:08:59.028107Z","shell.execute_reply.started":"2023-09-27T09:08:33.466767Z","shell.execute_reply":"2023-09-27T09:08:59.026931Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_all.head()","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:59.029640Z","iopub.execute_input":"2023-09-27T09:08:59.030079Z","iopub.status.idle":"2023-09-27T09:08:59.056855Z","shell.execute_reply.started":"2023-09-27T09:08:59.030044Z","shell.execute_reply":"2023-09-27T09:08:59.055788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Prepare Data","metadata":{}},{"cell_type":"code","source":"features = [\"step\", \"hour\",\"dayofweek\",\"anglez_times_enmo\",\n            \"anglez\",\"anglez_diff\",\"anglez_mean\",\"anglez_min\",\"anglez_max\",\"anglez_std\",\"anglez_diff_rolling\",\n            \"enmo\",\"enmo_diff\",\"enmo_mean\",\"enmo_min\",\"enmo_max\",\"enmo_std\",\"enmo_diff_rolling\"]\ntarget = 'awake'\n\nscaler = StandardScaler()\n\ndf_train_X_scaled = scaler.fit_transform(train_all[features])\ndf_train_y = train_all[target].values","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:08:59.058528Z","iopub.execute_input":"2023-09-27T09:08:59.058921Z","iopub.status.idle":"2023-09-27T09:09:00.075561Z","shell.execute_reply.started":"2023-09-27T09:08:59.058877Z","shell.execute_reply":"2023-09-27T09:09:00.074517Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Split Data","metadata":{}},{"cell_type":"code","source":"from torch import tensor\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\nimport torch.nn.functional as F\n\ndef_device = 'mps' if torch.backends.mps.is_available() else 'cuda' if torch.cuda.is_available() else 'cpu'\ndef_device","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.076881Z","iopub.execute_input":"2023-09-27T09:09:00.077847Z","iopub.status.idle":"2023-09-27T09:09:00.112892Z","shell.execute_reply.started":"2023-09-27T09:09:00.077810Z","shell.execute_reply":"2023-09-27T09:09:00.111290Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = tensor(df_train_X_scaled, dtype=torch.float32)\ny = tensor(df_train_y, dtype=torch.long)\n\nX.shape, y.shape","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.114480Z","iopub.execute_input":"2023-09-27T09:09:00.115687Z","iopub.status.idle":"2023-09-27T09:09:00.291469Z","shell.execute_reply.started":"2023-09-27T09:09:00.115653Z","shell.execute_reply":"2023-09-27T09:09:00.290460Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"split_index = int(len(X) * 0.8)\n\nX_train = X[:split_index]\nX_val = X[split_index:]\n\ny_train = y[:split_index]\ny_val = y[split_index:]\n\nX_train.shape, y_train.shape, X_val.shape, y_val.shape","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.295969Z","iopub.execute_input":"2023-09-27T09:09:00.296258Z","iopub.status.idle":"2023-09-27T09:09:00.306263Z","shell.execute_reply.started":"2023-09-27T09:09:00.296232Z","shell.execute_reply":"2023-09-27T09:09:00.305073Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Create DataLoader","metadata":{}},{"cell_type":"code","source":"class TimeSeriesDataset(Dataset):\n    def __init__(self, X, y):\n        self.X, self.y = X, y\n        \n    def __len__(self):\n        return len(self.X)\n    \n    def __getitem__(self, i):\n        return self.X[i], self.y[i]\n    \ntrain_ds, val_ds = TimeSeriesDataset(X_train,y_train), TimeSeriesDataset(X_val, y_val)\nbatch_size = 12*60 # 1 hour\n\ntrain_dl, val_dl = DataLoader(train_ds, batch_size=batch_size, shuffle=False), DataLoader(val_ds, batch_size=batch_size, shuffle=False)","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.307919Z","iopub.execute_input":"2023-09-27T09:09:00.308324Z","iopub.status.idle":"2023-09-27T09:09:00.316492Z","shell.execute_reply.started":"2023-09-27T09:09:00.308292Z","shell.execute_reply":"2023-09-27T09:09:00.315390Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Define LSTM Model","metadata":{}},{"cell_type":"code","source":"class LSTM(nn.Module):\n    def __init__(self, input_size, hidden_size, num_layers, output_size):\n        super().__init__()\n        self.hidden_size = hidden_size\n        self.num_layers = num_layers\n        self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True)\n        self.relu = nn.ReLU()\n        self.fc = nn.Linear(hidden_size, output_size)\n    \n    def forward(self, x):\n        batch_size = x.size(0)\n        h0 = torch.zeros(self.num_layers, batch_size, self.hidden_size).to(def_device)\n        c0 = torch.zeros(self.num_layers, batch_size, self.hidden_size).to(def_device)\n        x = x[:,None,:] # to 3D dimension\n        out, _ = self.lstm(x, (h0, c0))\n        out = self.fc(self.relu(out[:, -1, :])) \n        return out","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.317958Z","iopub.execute_input":"2023-09-27T09:09:00.318294Z","iopub.status.idle":"2023-09-27T09:09:00.329283Z","shell.execute_reply.started":"2023-09-27T09:09:00.318261Z","shell.execute_reply":"2023-09-27T09:09:00.328369Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Train","metadata":{}},{"cell_type":"code","source":"from tqdm import tqdm\n\ndef accuracy(out, yb): \n    return (out.argmax(axis=1) == yb).float().mean() # Evaluate the accuracy of the model.\n\ndef fit(epochs, model, loss_func, opt, train_dl, valid_dl):\n    for epoch in range(epochs):\n        print(f'Starting epoch {epoch+1} train')\n        progress_bar = tqdm(train_dl)\n        model.train(True)\n        for xb, yb in progress_bar:\n            xb, yb = xb.to(def_device), yb.to(def_device)\n            loss = loss_func(model(xb), yb)\n            loss.backward()\n            opt.step()\n            opt.zero_grad()\n            progress_bar.set_description(f'Loss: {loss.item():.3f}')\n        model.eval()\n        with torch.no_grad():\n            tot_loss, tot_acc, count = 0., 0.,0\n            print(f'Starting epoch {epoch+1} eval')\n            progress_bar = tqdm(valid_dl)\n            for xb,yb in progress_bar:\n                xb, yb = xb.to(def_device), yb.to(def_device)\n                pred = model(xb)\n                n = len(xb)\n                count += n\n                tot_loss += loss_func(pred, yb).item()*n\n                tot_acc += accuracy(pred, yb).item()*n\n        print(f'epoch:{epoch}, loss: {tot_loss/count:.2f}, accuracy: {tot_acc/count:.2f}')\n    return tot_loss/count, tot_acc/count\n\ndef predict(x):\n    with torch.no_grad():\n        predicted = model(x.to(def_device)).to('cpu')\n    score = F.log_softmax(predicted, -1).exp()\n    value = score.argmax(axis=1)\n    return score, value","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.330663Z","iopub.execute_input":"2023-09-27T09:09:00.331208Z","iopub.status.idle":"2023-09-27T09:09:00.343661Z","shell.execute_reply.started":"2023-09-27T09:09:00.331174Z","shell.execute_reply":"2023-09-27T09:09:00.342679Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"input_size = len(features)\nhidden_size = 32 # like 1 2 4 32 64\nnum_layers = 2\noutput_size = 2\n\nmodel = LSTM(input_size, hidden_size, num_layers, output_size)\nopt = torch.optim.Adam(model.parameters(), lr=0.001)\nloss_func = F.cross_entropy\n\nmodel.to(def_device)\nmodel","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:00.344965Z","iopub.execute_input":"2023-09-27T09:09:00.346206Z","iopub.status.idle":"2023-09-27T09:09:02.584267Z","shell.execute_reply.started":"2023-09-27T09:09:00.346180Z","shell.execute_reply":"2023-09-27T09:09:02.583350Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%time loss,acc = fit(4, model, loss_func, opt, train_dl, val_dl)","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:09:02.588234Z","iopub.execute_input":"2023-09-27T09:09:02.594736Z","iopub.status.idle":"2023-09-27T09:11:22.414179Z","shell.execute_reply.started":"2023-09-27T09:09:02.594709Z","shell.execute_reply":"2023-09-27T09:11:22.413146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"xb, yb = next(iter(train_dl))\nprint(xb.shape, yb.shape)","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:22.415759Z","iopub.execute_input":"2023-09-27T09:11:22.416116Z","iopub.status.idle":"2023-09-27T09:11:22.430826Z","shell.execute_reply.started":"2023-09-27T09:11:22.416082Z","shell.execute_reply":"2023-09-27T09:11:22.429962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"score, pred_value = predict(xb)\nprint(f'accuracy: {accuracy(score, yb)}')\ndef plot_predicate(act_value, pred_value):\n    plt.figure(figsize=(20,3))\n    plt.plot(act_value, label='Actual Awake')\n    plt.plot(pred_value, label='Predicted Awake')\n    plt.xlabel('Day')\n    plt.ylabel('Awake')\n    plt.legend()\n    plt.show()\nplot_predicate(yb, pred_value)","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:22.432171Z","iopub.execute_input":"2023-09-27T09:11:22.432525Z","iopub.status.idle":"2023-09-27T09:11:22.733458Z","shell.execute_reply.started":"2023-09-27T09:11:22.432492Z","shell.execute_reply":"2023-09-27T09:11:22.732466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Predict Train Set","metadata":{}},{"cell_type":"code","source":"def data_transform(df):\n    df = add_features(df)\n    df_scaler = scaler.transform(df[features])\n    return tensor(df_scaler, dtype=torch.float32)","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:22.734828Z","iopub.execute_input":"2023-09-27T09:11:22.735269Z","iopub.status.idle":"2023-09-27T09:11:22.741956Z","shell.execute_reply.started":"2023-09-27T09:11:22.735232Z","shell.execute_reply":"2023-09-27T09:11:22.740574Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def predict_train_set(predict_series_ids):\n    for series_id in predict_series_ids:\n        pred_df = get_multi_light_series([series_id])\n        pred_data = data_transform(pred_df)\n        score, pred_value = predict(pred_data.to(def_device))\n        act_y = tensor(pred_df['awake'].to_numpy())\n        print(f'accuracy: {accuracy(score, act_y):.2f}')\n        plot_predicate(pred_df['awake'], pred_value)\n\npredict_train_set(train_ids[30:32]) ","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:22.744541Z","iopub.execute_input":"2023-09-27T09:11:22.744946Z","iopub.status.idle":"2023-09-27T09:11:55.402562Z","shell.execute_reply.started":"2023-09-27T09:11:22.744912Z","shell.execute_reply":"2023-09-27T09:11:55.401172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"del train_all, X_train, y_train\ngc.collect()","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:55.404445Z","iopub.execute_input":"2023-09-27T09:11:55.404881Z","iopub.status.idle":"2023-09-27T09:11:55.527299Z","shell.execute_reply.started":"2023-09-27T09:11:55.404823Z","shell.execute_reply":"2023-09-27T09:11:55.525877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Predict Test Set","metadata":{}},{"cell_type":"code","source":"def get_test_series_ids():\n    return pd.read_parquet(\"/kaggle/input/child-mind-institute-detect-sleep-states/test_series.parquet\", columns=['series_id'])['series_id'].unique()\n\ndef get_test_series(series_id):\n    return pd.read_parquet(\"/kaggle/input/child-mind-institute-detect-sleep-states/test_series.parquet\", \n                           columns=['series_id','timestamp', 'anglez', 'enmo', 'step'], \n                           filters=[('series_id', '=', series_id)])\n\ndef get_event(df):\n    lstCV = zip(df.series_id, df.smooth)\n    lstPOI = []\n    for (c, v), g in groupby(lstCV, lambda cv: (cv[0], cv[1] != 0 and not pd.isnull(cv[1]))):\n        llg = sum(1 for item in g)\n        if v is False:\n            lstPOI.extend([0] * llg)\n        else:\n            lstPOI.extend(['onset'] + (llg - 2) * [0] + ['wakeup'] if llg > 1 else [0])\n    return lstPOI","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:55.529304Z","iopub.execute_input":"2023-09-27T09:11:55.529714Z","iopub.status.idle":"2023-09-27T09:11:55.540588Z","shell.execute_reply.started":"2023-09-27T09:11:55.529679Z","shell.execute_reply":"2023-09-27T09:11:55.539537Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def multi_series_prediction(test_series_ids):\n    for series_id in test_series_ids:\n        single_series = get_test_series(series_id)\n        X_test = data_transform(single_series)\n        score, _ = predict(X_test.to(def_device))\n        \n        \n        single_series[\"not_awake\"] = score[:,0]\n        single_series['awake'] = score[:,1]\n\n        smoothing_length =  2*230\n        single_series[\"score\"] = single_series[\"awake\"].rolling(smoothing_length,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n        single_series[\"smooth\"] = single_series[\"not_awake\"].rolling(smoothing_length,center=True).mean().fillna(method=\"bfill\").fillna(method=\"ffill\")\n        single_series[\"smooth\"] = single_series[\"smooth\"].round()\n        single_series[\"event\"] = get_event(single_series)\n        \n        \n        df = single_series.loc[single_series[\"event\"] != 0][[\"series_id\",\"step\",\"event\",\"score\"]].copy().reset_index(drop=True)\n        df.to_csv(f'{series_id}.csv', index=False)\n        del df, single_series\n        gc.collect()\n    return\n  \ndef combine_predictions(test_series):\n    sub = pd.read_csv(f'{test_series[0]}.csv')\n    for series in test_series[1:]:\n        temp = pd.read_csv(f'{series}.csv')\n        sub = pd.concat([sub, temp], ignore_index=True)\n        del temp\n        gc.collect()\n    sub = sub.copy().reset_index(drop=True).reset_index(names=\"row_id\")\n    sub.to_csv('submission.csv', index=False)\n    return sub","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:55.542370Z","iopub.execute_input":"2023-09-27T09:11:55.542828Z","iopub.status.idle":"2023-09-27T09:11:55.556042Z","shell.execute_reply.started":"2023-09-27T09:11:55.542791Z","shell.execute_reply":"2023-09-27T09:11:55.555269Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_series_ids = get_test_series_ids()\ntest_series_ids","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:55.557570Z","iopub.execute_input":"2023-09-27T09:11:55.558230Z","iopub.status.idle":"2023-09-27T09:11:55.578779Z","shell.execute_reply.started":"2023-09-27T09:11:55.558192Z","shell.execute_reply":"2023-09-27T09:11:55.577608Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"multi_series_prediction(test_series_ids)\nsub = combine_predictions(test_series_ids)\nsub.head()","metadata":{"execution":{"iopub.status.busy":"2023-09-27T09:11:55.580282Z","iopub.execute_input":"2023-09-27T09:11:55.580859Z","iopub.status.idle":"2023-09-27T09:11:56.304641Z","shell.execute_reply.started":"2023-09-27T09:11:55.580816Z","shell.execute_reply":"2023-09-27T09:11:56.303501Z"},"trusted":true},"execution_count":null,"outputs":[]}]}