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 re | |
from functools import partial | |
L_BR = "__LBR__" | |
R_BR = "__RBR__" | |
class SimpleTemplate: | |
"""A super simple templating engine that will handle arbitrarily nested context. | |
Templated properties are marked by `{ ... }`. Attributes of the context are dot-delimited. |
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
""" | |
**** | |
CAUTION: This is the wrong approach and will not work for all requests! | |
Instead of parsing out the json data, the content body should just simply be passed | |
through to mlflow. I will get a fix in soon. | |
**** | |
A simple proxy to put an authentication layer in front of mlflow. |
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
""" | |
Original code by @dantownsend | |
Minor tweets by @scott2b | |
See: https://github.com/piccolo-orm/piccolo/issues/662 | |
""" | |
from piccolo.table import Table | |
from piccolo.columns.column_types import Integer, JSON | |
from piccolo.engine.sqlite import SQLiteEngine | |
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
"""An example of a cache decorator.""" | |
import json | |
from functools import wraps | |
from redis import StrictRedis | |
redis = StrictRedis() | |
def cached(func): |
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 request.session.messages %} | |
<ul> | |
{% for message in request.session.messages %} | |
<li>{{ message }}</li> | |
{% endfor %} | |
</ul> | |
{{ request.clear_messages() }} | |
{% endif %} |
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 os | |
import re | |
class ConfigurationError(Exception): pass | |
def replacer(m): | |
var = m.group(2)[2:-1].strip() | |
try: | |
return f'{m.group(1)}{os.environ[var]}{m.group(3)}' |
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
* | |
/ | |
+ | |
- | |
2 + 2 |
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
""" | |
To run as a standalone script, set your CONSUMER_KEY and CONSUMER_SECRET. To | |
call search from code, pass in your credentials to the search_twitter function. | |
Script to fetch a twitter search of tweets into a directory. Fetches all available | |
tweet history accessible by the application (7 days historical). | |
USAGE: | |
$ python search.py [--new|--nozip] query terms |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script crossorigin src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script> | |
<script crossorigin src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
<link title="timeline-styles" rel="stylesheet" href="https://cdn.knightlab.com/libs/timeline3/latest/css/timeline.css"> | |
<script src="https://cdn.knightlab.com/libs/timeline3/latest/js/timeline.js"></script> | |
<style> | |
div#timeline-embed { |
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
time="2018-08-03T19:07:57Z" level=debug msg="Global configuration loaded {\"LifeCycle\":{\"RequestAcceptGraceTimeout\":0,\"GraceTimeOut\":10000000000},\"GraceTimeOut\":0,\"Debug\":false,\"CheckNewVersion\":true,\"SendAnonymousUsage\":false,\"AccessLogsFile\":\"\",\"AccessLog\":null,\"TraefikLogsFile\":\"\",\"TraefikLog\":null,\"Tracing\":null,\"LogLevel\":\"DEBUG\",\"EntryPoints\":{\"http\":{\"Address\":\":80\",\"TLS\":null,\"Redirect\":null,\"Auth\":null,\"WhitelistSourceRange\":null,\"WhiteList\":null,\"Compress\":false,\"ProxyProtocol\":null,\"ForwardedHeaders\":{\"Insecure\":true,\"TrustedIPs\":null}},\"traefik\":{\"Address\":\":8080\",\"TLS\":null,\"Redirect\":null,\"Auth\":null,\"WhitelistSourceRange\":null,\"WhiteList\":null,\"Compress\":false,\"ProxyProtocol\":null,\"ForwardedHeaders\":{\"Insecure\":true,\"TrustedIPs\":null}}},\"Cluster\":null,\"Constraints\":[],\"ACME\":null,\"DefaultEntryPoints\":[\"http\"],\"ProvidersThrottleDuration\":2000000000,\"MaxIdleConnsPerHost\":200,\"IdleTimeout\":0,\"Inse |
NewerOlder