{"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":"# 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\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 read-only \"../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\n# for dirname, _, filenames in os.walk('/kaggle/input'):\n#     for filename in filenames:\n#         print(os.path.join(dirname, filename))\nimport torch\n\nprint(torch.rand(30000,30000).matmul(torch.rand(30000,30000)))  # 15:06\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"b784606d-a3e2-450b-b45a-6467506b2aff","_cell_guid":"4418d8f4-0a39-4a59-bdb6-757b31ebe614","collapsed":false,"jupyter":{"outputs_hidden":false},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Cloud Storage\nfrom google.cloud import storage\nstorage_client = storage.Client('plant')  # YOUR PROJECT ID\nprint(dir(storage_client))\nbucket = storage_client.bucket('test')\nblob = bucket.blob('Dataset/OC256_32x32.mat')\nblob.download_to_filename('/kaggle/working/a.mat')\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nos.mkdir('/kaggle/working/test')","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from apiclient import discovery\nfrom httplib2 import Http\nimport oauth2client\nfrom oauth2client import file, client, tools\nobj = lambda: None\nlmao = {\"auth_host_name\":'localhost', 'noauth_local_webserver':'store_true', 'auth_host_port':[8080, 8090], 'logging_level':'ERROR'}\nfor k, v in lmao.items():\n    setattr(obj, k, v)\n    \n# authorization boilerplate code\nSCOPES = 'https://www.googleapis.com/auth/drive.readonly'\nstore = file.Storage('token.json')\ncreds = store.get()\n# The following will give you a link if token.json does not exist, the link allows the user to give this app permission\nif not creds or creds.invalid:\n    flow = client.flow_from_clientsecrets('client_id.json', SCOPES)\n    creds = tools.run_flow(flow, store, obj)","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]}