This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from collections import OrderedDict | |
| from pandas.core.indexes.multi import MultiIndex | |
| def multiindex_to_nested_dict(df: pd.DataFrame, value_only = False) -> OrderedDict: | |
| if isinstance(df.index, MultiIndex): | |
| return OrderedDict((k, multiindex_to_nested_dict(df.loc[k])) for k in df.index.remove_unused_levels().levels[0]) | |
| else: | |
| if value_only: | |
| return OrderedDict((k, df.loc[k].values[0]) for k in df.index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
Bookmarklet Browser Enhancement Readability
Readable is an application that helps you read more of the web. It reformats text — on any website — according to your exact specifications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example #1 - no styling --> | |
| Made with ❤ in Switzerland | |
| Made with ♥ in Switzerland | |
| Made with ♡ in Switzerland | |
| Made with ❤️ in Switzerland | |
| Made with ♥️ in Switzerland | |
| <!-- Example #2 - inline-styled ❤ --> | |
| Made with <span style="color: #e25555;">♥</span> in Switzerland | |
| Made with <span style="color: #e25555;">♥</span> in Switzerland |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import re | |
| import requests | |
| import sys | |
| from Crypto.Cipher import AES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from timeit import timeit | |
| import asyncio | |
| import requests | |
| from threading import Thread | |
| import aiohttp | |
| client = aiohttp.ClientSession() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf8 | |
| import sys, urllib2 | |
| import socks | |
| from sockshandler import SocksiPyHandler | |
| from urlparse import urlparse | |
| if len(sys.argv) < 2: | |
| print 'Usage: python %s [url]' % sys.argv[0] | |
| exit() |

