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 edward as ed | |
import numpy as np | |
import tensorflow as tf | |
from edward.models import Variational, Normal | |
from edward.stats import bernoulli, beta | |
import pandas_datareader as pdr | |
class AR1(object): |
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
""" | |
Created By: Trent Hauck | |
Date: 2015-09-18T21:52:35 | |
License: Use the shit out of it. | |
""" | |
# pylint: disable=no-init, too-few-public-methods | |
from pandas.tseries import holiday as h | |
from pandas.tseries import offsets as o |
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 prometheus_client import Summary | |
from prometheus_client.exposition import generate_latest | |
from flask_restful import Resource | |
from flask import Response | |
REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request') | |
class Metrics(Resource): | |
""" Resource for exposing metrics to prometheus. """ |
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
docker-machine create \ | |
--driver amazonec2 \ | |
--amazonec2-access-key $ACCESS_KEY \ | |
--amazonec2-secret-key $SECRET_KEY \ | |
--amazonec2-vpc-id $VPC \ | |
--amazonec2-security-group $SECURITY_GROUP \ | |
--amazonec2-instance-type "m4.2xlarge" \ | |
--amazonec2-root-size 20 \ | |
--amazonec2-request-spot-instance \ | |
--amazonec2-spot-price 0.20 \ |
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 linkbase_type(filepath): | |
"""Get the type of linkbase from the filename.""" | |
cases = ( | |
(filepath.endswith("_cal.xml"), "calculation"), | |
(filepath.endswith('_def.xml'), "definition"), | |
(filepath.endswith('_lab.xml'), "label"), | |
(filepath.endswith('_pre.xml'), "presentation"), | |
(filepath.endswith('.xsd'), "reference"), | |
(filepath.endswith('.xml'), "filing"), |
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 simpy | |
import time | |
import pandas as pd | |
import datetime as dt | |
import numpy as np | |
import metrics | |
class DatedEnvironment(simpy.Environment): | |
def __init__(self, start_time, end_time, offset='h', initial_time=0): |