Skip to content

Instantly share code, notes, and snippets.

View ywolff's full-sized avatar

Yannick Wolff ywolff

View GitHub Profile
@ywolff
ywolff / caesar_encryption.py
Last active July 14, 2019 18:48
Caesar cipher script
def encrypt(plaintext, key):
cyphertext = ''
for character in plaintext:
if character.isalpha():
number = ord(character)
number += key
if character.isupper():
if number > ord('Z'):
number -= 26
elif number < ord('A'):
import sys
from caesar_encryption import encrypt
def caesar():
key = 1
is_error = False
for index, arg in enumerate(sys.argv):
import argparse
from caesar_encryption import encrypt
def caesar():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-e', '--encrypt', action='store_true')
group.add_argument('-d', '--decrypt', action='store_true')
import click
from caesar_encryption import encrypt
@click.command()
@click.argument('text', nargs=-1)
@click.option('--decrypt/--encrypt', '-d/-e')
@click.option('--key', '-k', default=1)
def caesar(text, decrypt, key):
text_string = ' '.join(text)
import click
from caesar_encryption import encrypt
@click.command()
@click.option(
'--input_file',
type=click.File('r'),
help='File in which there is the text you want to encrypt/decrypt.'
'If not provided, a prompt will allow you to type the input text.',
import click
import enchant
from caesar_encryption import encrypt
@click.command()
@click.option(
'--input_file',
type=click.File('r'),
required=True,
import click
import enchant
from tqdm import tqdm
from caesar_encryption import encrypt
@click.command()
@click.option(
'--input_file',
from tensorflow.keras.layers import Dense
from tensorflow.keras import Model, Input
def build_big_model(
# small input and output in order to avoid latency due to data transfer through the internet during our tests
input_width=10,
output_width=10,
hidden_layers_width=10**4,
nb_hidden_layers=200,
import numpy as np
from flask import Flask, request
from build_big_model import build_big_model
model = build_big_model()
app = Flask(__name__)
import numpy as np
from locust import HttpLocust, TaskSet, task, between
INPUT_WIDTH = 10
class PredictTaskSet(TaskSet):
@task(1)
def predict(self):
payload = {