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 test_get_price(): | |
exchange_gw = UniswapGateway() | |
usdt = Token(address="0xdAC17F958D2ee523a2206206994597C13D831ec7") | |
wbtc = Token(address="0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599") | |
order = Order( | |
inp_token=usdt, | |
out_token=wbtc, | |
amount=1 | |
) |
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
#!/Users/kayibal/miniconda3/bin/python | |
import boto3 | |
import click | |
from urllib.parse import urlparse, urlunparse | |
def pypi_url(env): | |
ssm = boto3.client("ssm") | |
url = ssm.get_parameter(Name=f"/CodeBuild/PyPi/{env}/url", WithDecryption=True)[ | |
"Parameter" | |
]["Value"] |
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 seaborn as sns | |
import matplotlib.pyplot as plt | |
sns.set_style('whitegrid') | |
sns.set_palette(sns.dark_palette((0.6, 0.6, 0.6), reverse=True)) | |
plt.rcParams["figure.figsize"] = (15, 7) |
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
(╯°□°)╯︵ ┻━┻ |
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 numpy as np | |
def compute_overlap(x1, x2, y1, y2): | |
if x2 >= y1 and y2 >= x1: | |
if x1 < y1 < x2 and x2 < y2: | |
return x2 - y1 | |
elif y1 < x1 < y2 and y2 < x2: | |
return y2 - x1 | |
elif x1 < y1 and y2 < x2: | |
return y2 - y1 |
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
"""Recommendation module. | |
This module deals with using lightFM models in production and includes a | |
LightFm subclass which provides a predict_online method to use in API or | |
similar scenarios. | |
""" | |
import operator | |
from logging import getLogger | |
import numpy as np |
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
# export PROJECT=is24_user_scoring | |
# export PROD_SETTINGS=is24.settings.production | |
# export VERSION=v2.0.1 | |
sleep 5m | |
cd /home/ec2-user | |
sudo pip install awscli | |
if [ ! -d "$PROJECT" ]; then | |
git clone [email protected]:datarevenue-berlin/$PROJECT.git | |
ln -s $PROJECT bin; | |
fi |
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 bash | |
git clone --recursive https://github.com/dmlc/xgboost | |
cd xgboost | |
sudo make -j4 | |
cd python-package | |
python3 setup.py install | |
rm -rf xgboost |
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 | |
import nltk | |
from nltk.tokenize.regexp import RegexpTokenizer | |
from nltk.corpus import stopwords | |
from sklearn.svm import SVC | |
from sklearn.naive_bayes import BernoulliNB | |
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA | |
from sklearn.feature_selection import SelectPercentile |
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 bash | |
MIN_LOAD=1 | |
ADMIN_NUMBERS=( "+49NUMBER1" "+49NUMBER2" ) | |
if ! who | grep -q *; then | |
echo "users logged in" | |
exit 0 | |
fi |
NewerOlder