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 pydocumentdb.document_client as document_client | |
host = 'https://doc01.documents.azure.com' | |
masterKey = 'PhA7+FAD9uHw+McP/sM4CFZA4dUnOrzmgnk0J+SEcvOC5ac7UYNu/EHvOEBcOpEtj6Vz/YESDoxxxsnoaLDCGg==' | |
client = document_client.DocumentClient(host, {'masterKey': masterKey}) | |
databases = client.ReadDatabases() | |
db = [db for db in databases if db['id'] == 'uvt01'][0] | |
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
configfile = '~/config.py' | |
import os | |
import sys | |
sys.path.append(os.path.dirname(os.path.expanduser(configfile))) | |
import config |
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 pydocumentdb.document_client as document_client | |
host = 'https://doc01.documents.azure.com' | |
masterKey = 'PhA7+FAD9uHw+McP/sM4CFZA4dUnOrzmgnk0J+SEcvOC5ac7UYNu/EHvOEBcOpEtj6Vz/YESDoxxxsnoaLDCGg==' | |
client = document_client.DocumentClient(host, {'masterKey': masterKey}) | |
databases = client.ReadDatabases() | |
db = [db for db in databases if db['id'] == 'uvt01'][0] |
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 json | |
from functools import wraps | |
from flask import request | |
from utils.exceptions import HttpNotFound | |
from utils.validators import Required | |
def require(f): | |
@wraps(f) |
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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'filters': {}, | |
'formatters': { | |
'syslog': { | |
'format': '%(asctime)s ' + HOSTNAME_SHORT + | |
' %(name)s: %(levelname)s: %(message)s', | |
'datefmt': '%b %d %H:%M:%S', | |
} |
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 a file that contains | |
* doc_id w1 w2 w3 ... lines, separated by tabs | |
* return an inverted index Map of w -> Set(doc_id) | |
* | |
* @param filename well isn't it obvious | |
* @return Map[String,Set[String]] | |
*/ | |
import scala.collection.immutable.Map |
NewerOlder