Skip to content

Instantly share code, notes, and snippets.

[package]
name = "ws-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.18.0", features = ["full"] }
jsonrpsee = { version = "0.11.0", features = ["full"] }
@chokosabe
chokosabe / ppo_train_eval.py
Last active September 16, 2020 13:53
A PPO train eval method
"""PPO Learner implementation."""
import gin
import tensorflow.compat.v2 as tf
from tf_agents.experimental.train import learner
from tf_agents.networks import utils
from tf_agents.utils import common
{"index" : {"_index": "library", "_type": "book", "_id": "1"}} { "title": "All Quiet on the Western Front","otitle": "Im Westen nichts Neues", "author": "Erich Maria Remarque","year": 1929,"characters": ["Paul Bäumer", "Albert Kropp", "Haie Westhus", "Fredrich Müller", "Stanislaus Katczinsky", "Tjaden"],"tags": ["novel"],"copies": 1, "available": true, "section" : 3} { "index": {"_index": "library", "_type": "book", "_id": "2"}} { "title": "Catch-22","author": "Joseph Heller","year": 1961,"characters": ["John Yossarian", "Captain Aardvark", "Chaplain Tappman", "Colonel Cathcart", "Doctor Daneeka"],"tags": ["novel"],"copies": 6, "available" : false, "section" : 1} { "index": {"_index": "library", "_type": "book", "_id": "3"}} { "title": "The Complete Sherlock Holmes","author": "Arthur Conan Doyle","year": 1936,"characters": ["Sherlock Holmes","Dr. Watson", "G. Lestrade"],"tags": [],"copies": 0, "available" : false, "section" : 12} { "index": {"_index": "library", "_type": "book", "_id": "4"}} { "title": "Cr
@chokosabe
chokosabe / ftse_100_symbols.py
Last active February 5, 2018 22:10
The component companies of the ftse 100 as a python dict as of April 2013
symbols = {
'AAL.L' : 'Anglo American PLC',
'ABF.L' : 'Associated British Foods PLC',
'ADM.L' : 'Admiral Group PLC',
'ADN.L' : 'Aberdeen Asset Management PLC',
'AGK.L' : 'Aggreko PLC',
'AMEC.L' : 'AMEC PLC',
'ANTO.L' : 'Antofagasta PLC',
'ARM.L' : 'ARM Holdings PLC',
'AV.L' : 'Aviva PLC',
@chokosabe
chokosabe / uk_holidays.py
Last active December 14, 2015 03:48 — forked from sebzur/polish_holidays.py
Copied over from polish_holidays.py
import calendar
from datetime import date, timedelta
from dateutil import easter
from dateutil.relativedelta import *
def get_holidays(year):
"""
Returns UK hollidays dates (legally considered non-working days)
Take a year argument, i.e year=2010
"""