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 pandas as pd | |
import time | |
from datetime import date | |
import pathlib | |
class Series(object): | |
def __init__(self, name, schema, start, end, freq, top=0, use_cache=False, flag=False): | |
self.df = None | |
self.name = name |
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 python3 | |
import pandas as pd | |
import pycountry | |
from datetime import date, timedelta | |
from fbprophet import Prophet | |
from concurrent.futures import ProcessPoolExecutor | |
from .base import Series | |
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 botocore.hooks import _PrefixTrie | |
import util | |
import boto3 | |
from .s3utils import upload_csv | |
import time | |
import pprint | |
class Pipeline: | |
def __init__(self, name, target, freq, horizon, s3_bucket, related=None, domain="RETAIL", |
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 unidecode import unidecode | |
import re | |
import sys | |
import inflection | |
import numpy as np | |
import math | |
from collections import defaultdict | |
# Using cosine_similarity, own faster implementation, inspired by | |
# https://towardsdatascience.com/calculating-string-similarity-in-python-276e18a7d33a |
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
package main | |
import "fmt" | |
var ( | |
requestToActor chan int | |
responseFromActor chan int | |
) | |
const ( |
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
func (broker *Broker) updateCPUIdle() { | |
select { | |
case broker.cpuUpdateChannel <- true: | |
default: | |
} | |
} | |
func (broker *Broker) cpuIdleUpdater() { | |
// Initial values required to get stats | |
minPeriod := 20 * time.Millisecond |
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
package main | |
import ( | |
"sync" | |
"time" | |
) | |
type SerieElement struct { | |
ts time.Time | |
data *BookingData |
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
func (soc *Socket) sendMessage(dontwait Flag, parts ...interface{}) (total int, err error) { | |
// TODO: make this faster | |
// Done, ;) | |
var partial int | |
// Pop the last empty slices | |
popempty: | |
for i := len(parts) - 1; i >= 0; i-- { | |
switch tLast := parts[i].(type) { | |
case []string: |
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 | |
import numpy.random as npr | |
SIZE=3030 | |
LOOP=1000000 | |
TIE=SIZE/2 | |
ties=0 |
NewerOlder