File size: 1,095 Bytes
26f54ce
1
{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import requests\nimport json\n\nurl = \"https://raw.githubusercontent.com/pratham19092006/ML-in-image/refs/heads/main/1.ipynb\" # 1 or 2 or 3\ncontent = requests.get(url).text\n\nnotebook = json.loads(content)\n\nall_code = \"\"\n\nfor cell in notebook[\"cells\"]:\n\n    if cell[\"cell_type\"] == \"code\":\n\n        code = \"\".join(cell[\"source\"])\n\n        all_code += code + \"\\n\\n\"\n\nprint(all_code)","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"outputs":[],"execution_count":null}]}