This file contains 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 dogpile.cache import make_region | |
# key dictionary | |
keys = dict() | |
def my_key_generator(namespace, fn, **kwargs): | |
fname = fn.__name__ | |
def generate_key(*arg): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 json | |
import geojson | |
import requests | |
class ClavinClient(object): | |
def __init__(self, clavin_endpoint=None): | |
if clavin_endpoint is None: | |
#self.clavin_endpoint = "http://54.186.35.170:9090/api/v0/geotag" |
This file contains 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
{"directed": false, "graph": {}, "nodes": [{"id": 716800}, {"id": 1017728}, {"id": 22275}, {"id": 592388}, {"id": 120709}, {"id": 498694}, {"id": 25099}, {"id": 1155212}, {"id": 677774}, {"id": 321039}, {"id": 121248}, {"id": 358806}, {"id": 196759}, {"id": 151576}, {"id": 1691674}, {"id": 385563}, {"id": 223901}, {"id": 379550}, {"id": 27717}, {"id": 583200}, {"id": 99708}, {"id": 555043}, {"id": 649253}, {"id": 55720}, {"id": 1152297}, {"id": 479794}, {"id": 1666738}, {"id": 950150}, {"id": 1390265}, {"id": 807866}, {"id": 1484732}, {"id": 580029}, {"id": 119614}, {"id": 470816}, {"id": 1438145}, {"id": 304324}, {"id": 1329477}, {"id": 411336}, {"id": 1603212}, {"id": 1280202}, {"id": 239820}, {"id": 114381}, {"id": 1627345}, {"id": 407843}, {"id": 1181785}, {"id": 516442}, {"id": 305115}, {"id": 36828}, {"id": 1264634}, {"id": 1239936}, {"id": 1051235}, {"id": 1175656}, {"id": 1574249}, {"id": 1266027}, {"id": 468845}, {"id": 1225149}, {"id": 943400}, {"id": 1421824}, {"id": 1690612}, {"id": 1669467}, {"id |
This file contains 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
{"directed": false, "graph": {}, "nodes": [{"id": 716800}, {"id": 1017728}, {"id": 22275}, {"id": 592388}, {"id": 120709}, {"id": 498694}, {"id": 25099}, {"id": 1155212}, {"id": 677774}, {"id": 321039}, {"id": 121248}, {"id": 358806}, {"id": 196759}, {"id": 151576}, {"id": 1691674}, {"id": 385563}, {"id": 223901}, {"id": 379550}, {"id": 27717}, {"id": 583200}, {"id": 99708}, {"id": 555043}, {"id": 649253}, {"id": 55720}, {"id": 1152297}, {"id": 479794}, {"id": 1666738}, {"id": 950150}, {"id": 1390265}, {"id": 807866}, {"id": 1484732}, {"id": 580029}, {"id": 119614}, {"id": 470816}, {"id": 1438145}, {"id": 304324}, {"id": 1329477}, {"id": 411336}, {"id": 1603212}, {"id": 1280202}, {"id": 239820}, {"id": 114381}, {"id": 1627345}, {"id": 407843}, {"id": 1181785}, {"id": 516442}, {"id": 305115}, {"id": 36828}, {"id": 1264634}, {"id": 1239936}, {"id": 1051235}, {"id": 1175656}, {"id": 1574249}, {"id": 1266027}, {"id": 468845}, {"id": 1225149}, {"id": 943400}, {"id": 1421824}, {"id": 1690612}, {"id": 1669467}, {"id |
This file contains 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
{ | |
"directed" : false, | |
"graph" : {}, | |
"nodes" : [{ | |
"id" : 1376262 | |
}, { | |
"id" : 1277961 | |
}, { | |
"id" : 163853 | |
}, { |
This file contains 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
{ | |
"directed" : false, | |
"graph" : {}, | |
"nodes" : [{ | |
"id" : 1376262 | |
}, { | |
"id" : 1277961 | |
}, { | |
"id" : 163853 | |
}, { |
This file contains 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
# If add is True (default, it will add them, else it merges. | |
def deepdictmerge(a, b, path=None, add=True): | |
if path is None: path = [] | |
for key in b: # for every key in b.. | |
if key not in a: # handle simple case where it's new | |
a[key] = b[key] | |
else: # key must be in a and b | |
# both dictionaries. | |
if isinstance(a[key], dict) and isinstance(b[key], dict): | |
deepdictmerge(a[key], b[key], path + [str(key)]) # recurse down |
This file contains 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, |
This file contains 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
function marginotes(els, options) { | |
var options = options || {} | |
var marginTooltips = document.getElementsByClassName('margintooltip') | |
var marginTooltip | |
if (marginTooltips.length === 0) { | |
marginTooltip = document.createElement('div') | |
marginTooltip.className = 'margintooltip' | |
marginTooltip.style.display = 'none' | |
document.body.appendChild(marginTooltip) | |
} else { |
OlderNewer