{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"","_uuid":"","trusted":true},"cell_type":"code","source":"import pandas as pd\nstage_2_detailed_class_info = pd.read_csv(\"../input/rsna-pneumonia-detection-challenge/stage_2_detailed_class_info.csv\")\nstage_2_sample_submission = pd.read_csv(\"../input/rsna-pneumonia-detection-challenge/stage_2_sample_submission.csv\")\nstage_2_train_labels = pd.read_csv(\"../input/rsna-pneumonia-detection-challenge/stage_2_train_labels.csv\")","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Declaration"},{"metadata":{"trusted":true},"cell_type":"code","source":"import os \nimport sys\nimport random\nimport math\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport json\nimport pydicom\nimport pandas as pd \nimport glob","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"DATA_DIR = \"../input/rsna-pneumonia-detection-challenge/\"\nROOT_DIR = '/kaggle/working'","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train_dicom_dir = os.path.join(DATA_DIR, 'stage_2_train_images')\ntest_dicom_dir = os.path.join(DATA_DIR, 'stage_2_test_images')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_1 = pd.merge(stage_2_detailed_class_info,stage_2_train_labels,on = 'patientId')\nprint(df_1.head(10))\nprint(df_1.shape)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Testing Connection with Data Files"},{"metadata":{"trusted":true},"cell_type":"code","source":"g_Train = glob.glob(train_dicom_dir + '/*.dcm')\ng_Test = glob.glob(test_dicom_dir + '/*.dcm')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"print (\"Total of %d DICOM images.\\nFirst 5 filenames:\" % len(g_Train))\nprint ('\\n'.join(g_Train[:5]))\nprint (\"Total of %d DICOM images.\\nFirst 5 filenames:\" % len(g_Test))\nprint ('\\n'.join(g_Test[:5]))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"%%time\n\nPathDicom = train_dicom_dir\nlstFilesDCM = []  # create an empty list\nFileName = []\nannotations = {}\nfor dirName, subdirList, fileList in os.walk(PathDicom):\n    for filename in fileList:\n        if \".dcm\" in filename.lower():  # check whether the file's DICOM\n            lstFilesDCM.append(os.path.join(dirName,filename))\n            FileName.append(filename.strip('.dcm'))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_2 = pd.DataFrame({'patientId':FileName,'path':lstFilesDCM})\nprint(df_2.head(10))\nprint(df_2.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_3 = pd.merge(df_1,df_2,on = 'patientId')\nprint(df_3.head(10))\nprint(df_3.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"image_annotations = {fp: [] for fp in lstFilesDCM}\nlen(image_annotations)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"anns = pd.read_csv(os.path.join(DATA_DIR, 'stage_2_train_labels.csv'))\nprint(anns.head(10))\nprint(anns.shape)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"for index, row in anns.iterrows(): \n    fp = os.path.join(PathDicom, row['patientId']+'.dcm')\n    image_annotations[fp].append(row)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"image_annotations","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"len(image_annotations)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#pd.DataFrame.from_dict(data)\nList_1 = [(k, v) for k, v in image_annotations.items()]\nprint(List_1[:10])\nprint(len(List_1))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_4 = pd.DataFrame(List_1)\nprint(df_4.head(10))\nprint(df_4.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_4.rename(columns={0: \"path_1\", 1:\"annotation\"}, inplace = True)\nprint(df_4.head(10))\nprint(df_4.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_4['annotation'][0][0][0]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"patientId_df = []\nfor index, row in df_4.iterrows():\n    patientId_df.append(df_4['annotation'][index][0][0])\nlen(patientId_df)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_4['patientId'] = patientId_df\nprint(df_4.head(10))\nprint(df_4.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5 = pd.merge(df_3,df_4,on = 'patientId')\nprint(df_5.head(10))\nprint(df_5.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"IMAGE_WIDTH = 1024\nIMAGE_HEIGHT = 1024","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5['original_height'] = IMAGE_HEIGHT","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5['original_width'] = IMAGE_WIDTH","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5.drop(['path_1'],axis=1,inplace = True)\ndf_5.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"df_5.to_csv('/kaggle/working/Data_Prep.csv')\nnp.save('Data_Prep.npy',df_5)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Testing Files"},{"metadata":{"trusted":true},"cell_type":"code","source":"import os \nimport sys\nimport random\nimport math\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport json\nimport pydicom\nimport pandas as pd \nimport glob\nos.getcwd()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset = np.load('/kaggle/working/Data_Prep.npy',allow_pickle = True)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset.astype","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset_DB =  pd.DataFrame(data=Dataset)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset_DB.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset_DB.rename(columns={0: \"patientId\", 1:\"class\",2:'x',3:'y',4:'width',5:'height',6:'Target',7:'path',8:'annotation',9:'original_height',10:'original_width'}, inplace = True)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset_DB.head(2)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"**START**"},{"metadata":{"trusted":true},"cell_type":"code","source":"from random import randint\n#Image_ID = 100\nImage_ID = randint(0,29280)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"fb = Dataset_DB['path'][Image_ID]\nimage_info = pydicom.read_file(fb)\nimage = image_info.pixel_array\nplt.imshow(image,cmap='gray')\nprint(Dataset_DB['patientId'][Image_ID])\nprint(image.shape)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if len(image.shape) != 3 or image.shape[2] != 3:\n            image = np.stack((image,) * 3, -1)\nimage.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"annotation = Dataset_DB['annotation'][Image_ID]\ncount = len(annotation)\nprint(count)\nif count == 0:\n    mask = np.zeros((Dataset_DB['original_height'][Image_ID], Dataset_DB['original_width'][Image_ID], 1), dtype=np.uint8)\nelse:\n    mask = np.zeros((Dataset_DB['original_height'][Image_ID], Dataset_DB['original_width'][Image_ID], count), dtype=np.uint8)\n   \n    for i, a in enumerate(annotation):\n        if a['Target'] == 1:\n            x = int(a['x'])\n            y = int(a['y'])\n            w = int(a['width'])\n            h = int(a['height'])\n            mask_instance = mask[:, :, i].copy()\n            cv2.rectangle(mask_instance, (x, y), (x+w, y+h), 255, -1)\n            mask[:, :, i] = mask_instance","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"masked = np.zeros(image.shape[:2])\nfor i in range(mask.shape[2]):\n    masked += image[:, :, 0] * mask[:, :, i]\nplt.imshow(masked, cmap='RdGy_r')\nplt.axis('off')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(10, 10))\nplt.subplot(1, 2, 1)\nplt.imshow(image)\nplt.axis('off')\n\nplt.subplot(1, 2, 2)\nmasked = np.zeros(image.shape[:2])\nfor i in range(mask.shape[2]):\n    masked += image[:, :, 0] * mask[:, :, i]\nplt.imshow(masked, cmap='gray')\nplt.axis('off')\n\nprint(Image_ID)\nprint(fb)\nprint(Dataset_DB['patientId'][Image_ID])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from keras.preprocessing.image import ImageDataGenerator\nfrom keras.applications.mobilenet import MobileNet, preprocess_input\nfrom keras.layers import Concatenate, UpSampling2D, Conv2D, Reshape\nfrom keras.models import Model, Sequential\nfrom keras.optimizers import Adam, RMSprop\nfrom keras.callbacks import EarlyStopping , ModelCheckpoint,ReduceLROnPlateau,Callback\nfrom keras.utils import Sequence","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"ALPHA = 1.0\nIMAGE_WIDTH = 224\nIMAGE_HEIGHT = 224\nEPOCHS = 5\nBATCH_SIZE = 8\nPATIENCE = 50\nMULTI_PROCESSING = False\nTHREADS = 1","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"\nfb","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Dataset_DB.head(10)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import cv2\nfrom sklearn.model_selection import train_test_split  \nfrom skimage.transform import resize\ntarining_pd = Dataset_DB.head(2000)\nx_train, x_test, y_train, y_test = train_test_split(tarining_pd, tarining_pd.Target, test_size=0.80, random_state=42)\n\nmasks = np.zeros((int(x_train.shape[0]), IMAGE_HEIGHT, IMAGE_WIDTH))\nX_train = np.zeros((int(x_train.shape[0]), IMAGE_HEIGHT, IMAGE_WIDTH, 3))\n\n#fb1 = x_train['path'].iloc[1]\n#image_info1 = pydicom.read_file(fb)\n#img1 = image_info.pixel_array\n#img1 = cv2.resize(img1, dsize=(IMAGE_HEIGHT, IMAGE_WIDTH), interpolation=cv2.INTER_CUBIC)\n#x = preprocess_input(np.array(img1, dtype=np.float32))\n#print(img1)\n#print('------------------------------')\n#print(x)\n#print('------------------------------')\n#print(x_train)\n#print('------------------------------')\n#X_train[1] = x\n#print(X_train[1])\nfor index in range(x_train.shape[0]):\n    fb = x_train['path'].iloc[index]\n    image_info = pydicom.read_file(fb)\n    #image_info = resize(image_info, (IMAGE_HEIGHT, IMAGE_WIDTH, 3))\n    img = image_info.pixel_array\n   # print(img.shape)\n    img = cv2.resize(img, dsize=(IMAGE_HEIGHT, IMAGE_WIDTH), interpolation=cv2.INTER_CUBIC)\n    #img = img[:,:,np.newaxis]\n    img = np.stack((img,)*3, axis=-1)\n    X_train[index] = preprocess_input(np.array(img, dtype=np.float32))\n    #print(X_train[index])\n    for i in X_train[index]:\n       # print(i)\n        x1 = int(i[0][0] * IMAGE_WIDTH)\n        x2 = int(i[1][1] * IMAGE_WIDTH)\n        y1 = int(i[0][0] * IMAGE_HEIGHT)\n        y2 = int(i[1][1] * IMAGE_HEIGHT)\n        masks[index][y1:y2, x1:x2] = 1","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"X_train[1]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def create_model(trainable=True):\n    # model = #### Add your code here ####\n    model = MobileNet(input_shape=(IMAGE_HEIGHT, IMAGE_WIDTH, 3), \n                      include_top=False, alpha=1.0, weights='imagenet')\n    for layer in model.layers:\n        layer.trainable = trainable\n\n    # Add all the UNET layers here\n    #### Add your code here ####\n\n    # getting the layers from mobilenet network\n    conv_pw_13_relu = model.get_layer(\"conv_pw_13_relu\").output\n    conv_pw_12_relu = model.get_layer(\"conv_pw_12_relu\").output\n    conv_pw_11_relu = model.get_layer(\"conv_pw_11_relu\").output\n    conv_pw_10_relu = model.get_layer(\"conv_pw_10_relu\").output\n    conv_pw_9_relu = model.get_layer(\"conv_pw_9_relu\").output\n    conv_pw_8_relu = model.get_layer(\"conv_pw_8_relu\").output\n    conv_pw_7_relu = model.get_layer(\"conv_pw_7_relu\").output\n    conv_pw_6_relu = model.get_layer(\"conv_pw_6_relu\").output\n    conv_pw_5_relu = model.get_layer(\"conv_pw_5_relu\").output\n    conv_pw_4_relu = model.get_layer(\"conv_pw_4_relu\").output\n    conv_pw_3_relu = model.get_layer(\"conv_pw_3_relu\").output\n    conv_pw_2_relu = model.get_layer(\"conv_pw_2_relu\").output\n    conv_pw_1_relu = model.get_layer(\"conv_pw_1_relu\").output\n    input_1 = model.layers[0].output\n\n    \n    # Adding Unet layers\n    # Each set will have 1 upsampling, then concat with the mobilenet layers having same shape\n    # followed by 2 conved layers with extra parameters\n\n    up2 = UpSampling2D()(conv_pw_13_relu)\n    concat1 = Concatenate()([up2, conv_pw_11_relu])\n    new_conv15 = Conv2D(512, 3, activation='relu', padding='same', kernel_initializer='he_normal')(concat1)\n    new_conv15 = Conv2D(512, 3, activation='relu', padding='same', kernel_initializer='he_normal')(new_conv15)\n\n    up3 = UpSampling2D()(concat1)\n    concat2 = Concatenate()([up3, conv_pw_5_relu])\n    new_conv16 = Conv2D(256, 3, activation='relu', padding='same', kernel_initializer='he_normal')(concat2)\n    new_conv16 = Conv2D(256, 3, activation='relu', padding='same', kernel_initializer='he_normal')(new_conv16)\n\n    up4 = UpSampling2D()(concat2)\n    concat3 = Concatenate()([up4, conv_pw_3_relu])\n    new_conv17 = Conv2D(128, 3, activation='relu', padding='same', kernel_initializer='he_normal')(concat3)\n    new_conv17 = Conv2D(128, 3, activation='relu', padding='same', kernel_initializer='he_normal')(new_conv17)\n\n    up5 = UpSampling2D()(concat3)\n    concat4 = Concatenate()([up5, conv_pw_1_relu])\n    new_conv17 = Conv2D(64, 3, activation='relu', padding='same', kernel_initializer='he_normal')(concat4)\n    new_conv17 = Conv2D(64, 3, activation='relu', padding='same', kernel_initializer='he_normal')(new_conv17)\n\n    up6 = UpSampling2D()(concat4)\n    concat5 = Concatenate()([up6, input_1])\n\n    outputs = Conv2D(1, kernel_size=1, activation=\"sigmoid\")(concat5)\n    outputs = Reshape((IMAGE_HEIGHT, IMAGE_WIDTH))(outputs)\n\n    # #### Add your code here ####\n    return Model(inputs=model.input, outputs=outputs)    ","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"model = create_model()\n\n# Print summary\nmodel.summary()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import tensorflow as tf\ndef dice_coefficient(y_true, y_pred):\n    numerator = 2 * tf.reduce_sum(y_true * y_pred)\n    denominator = tf.reduce_sum(y_true + y_pred)\n\n    return numerator / (denominator + tf.keras.backend.epsilon())","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from tensorflow.keras.losses import binary_crossentropy\nfrom tensorflow.keras.backend import log, epsilon\ndef loss(y_true, y_pred):\n    return binary_crossentropy(y_true, y_pred) - log(dice_coefficient(y_true, y_pred) + epsilon())","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"model.compile(optimizer='Adam', loss=loss, metrics=[dice_coefficient])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau\ncheckpoint = ModelCheckpoint(\"model-{loss:.2f}.h5\", monitor=\"loss\", verbose=1, save_best_only=True,\n                             save_weights_only=True, mode=\"min\", period=1)\nstop = EarlyStopping(monitor=\"loss\", patience=2, mode=\"min\")\nreduce_lr = ReduceLROnPlateau(monitor=\"loss\", factor=0.2, patience=5, min_lr=1e-6, verbose=1, mode=\"min\")","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"print(X_train.shape)\nprint(masks.shape)\nmodel.fit(X_train,masks, epochs=30,batch_size = 1, verbose=1, callbacks=[checkpoint, reduce_lr, stop])\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#from google.colab.patches import cv2_imshow\nn = 10\nTHRESHOLD = 0.1\nEPSILON = 0.02\nHEIGHT_CELLS = 28\nWIDTH_CELLS = 28\n\nCELL_WIDTH = IMAGE_WIDTH / WIDTH_CELLS\nCELL_HEIGHT = IMAGE_HEIGHT / HEIGHT_CELLS\n\nsample_image =X_train[1]\nprint(sample_image)\nfeat_scaled = preprocess_input(np.array(sample_image, dtype=np.float32))\nregion = model.predict(x=np.array([feat_scaled]))[0]\n#np.zeros((int(x_train.shape[0]), IMAGE_HEIGHT, IMAGE_WIDTH, 3))\noutput = np.zeros(sample_image.shape[:2], dtype=np.uint8)\n#output = np.zeros(int(X_train.shape[0]), dtype=np.uint8)\nfor i in range(region.shape[1]):\n    for j in range(region.shape[0]):\n        if region[i][j] > THRESHOLD:\n            x = int(CELL_WIDTH * j * sample_image.shape[1] / IMAGE_WIDTH)\n            y = int(CELL_HEIGHT * i * sample_image.shape[0] / IMAGE_HEIGHT)\n            x2 = int(CELL_WIDTH * (j + 1) * sample_image.shape[1] / IMAGE_WIDTH)\n            y2 = int(CELL_HEIGHT * (i + 1) * sample_image.shape[0] / IMAGE_HEIGHT)\n\n            output[y:y2,x:x2] = 1\n\n\n\nX0 = ((sample_image[0]) * IMAGE_WIDTH / IMAGE_HEIGHT)\n\ncontours,hierachy = cv2.findContours(output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n\n#print(contours) \nfor cnt in contours:\n    approx = cv2.approxPolyDP(cnt, EPSILON * cv2.arcLength(cnt, True), True)\n    x, y, w, h = cv2.boundingRect(approx)\n    cv2.rectangle(sample_image, (x, y), (x + w, y + h), (0, 255, 0), 1)\n\nplt.imshow(sample_image)\nplt.show()\n#cv2.waitKey(0)\n#cv2.imshow(\"image\", sample_image)\n#cv2.waitKey(0)\n#cv2.destroyAllWindows()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"feat_scaled = preprocess_input(np.array(sample_image, dtype=np.float32))\n\npred_mask = cv2.resize(1.0*(model.predict(x=np.array([feat_scaled]))[0] > 0.5), (IMAGE_WIDTH,IMAGE_HEIGHT))\n\nimage2 = sample_image\nimage2[:,:,0] = pred_mask*sample_image[:,:,0]\nimage2[:,:,1] = pred_mask*sample_image[:,:,1]\nimage2[:,:,2] = pred_mask*sample_image[:,:,2]\n\nout_image = image2\nplt.imshow(out_image)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"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":4,"nbformat_minor":4}