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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import argparse | |
from swissknife.script import common_setup | |
import plotly.graph_objs as go | |
import plotly.io as pio | |
parser = argparse.ArgumentParser( |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import unittest, json | |
from woohook import * | |
class TestWoo(unittest.TestCase): | |
def test_authenticate(self): |
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
def compute(body): | |
secret = '<here is my secret key>' | |
dig = hmac.new(secret.encode(), | |
msg = body.encode(), | |
digestmod = hashlib.sha256 | |
).digest() | |
computed = base64.b64encode(dig).decode() | |
return computed |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import hmac | |
import hashlib | |
import base64 | |
import unittest | |
import argparse | |
import logging | |
import sys |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests, urlparse | |
import json | |
import argparse | |
import logging | |
parser = argparse.ArgumentParser( | |
description = """DOC""", |
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
# -*- coding: utf-8 -*- | |
# coding: utf8 | |
import requests | |
#from requests.auth import HTTPBasicAuth | |
from storage import Storage | |
@auth.requires_login() | |
def index(): |
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 shapely.geometry import MultiPoint, Point, Polygon | |
from scipy.spatial import Voronoi | |
import numpy as np | |
import matplotlib.pyplot as plt | |
""" | |
1. buffer di max 20 m intorno al poligono building | |
2. selezione dei punti contenuti nel buffer | |
3. suddivizione del poligono originario in aree di voronoi come qui di seguito | |
4. assegnazione per ogni poligono di voronoi delle caratteristiche del punto |
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
# -*- coding: utf-8 -*- | |
osm = DAL(myconf.get('osm.uri'), | |
pool_size = myconf.get('osm.pool_size'), | |
migrate_enabled = False, | |
check_reserved = ['all'], | |
lazy_tables = True | |
) | |
commons = osm.Table(osm, "commons", |
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
class conf: | |
def __init__(self, path): | |
self.config = configparser.SafeConfigParser() | |
self.config.read(path) | |
self.path = path | |
def write(self, section, option, value): | |
""" | |
http://www.programcreek.com/python/example/1033/ConfigParser.SafeConfigParser |
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
# -*- coding: utf-8 -*- | |
import bisect | |
from itertools import izip | |
class Squeue(object): | |
""" """ | |
def __init__(self, _iter, key=None): | |
super(Squeue, self).__init__() |