Skip to content

Instantly share code, notes, and snippets.

# encoding: utf-8
import io
import torch
import json
import numpy as np
vocab = torch.load('data/vocab.pt')
np.savez_compressed(file='data/embedding.npz', embedding=vocab.embed)
with open('data/word2id.json', 'w') as f:
This file has been truncated, but you can view the full file.
{"unsupportable": 128318, "Villalon": 118160, "nunnery": 97674, "Plasticine": 144240, "woods": 5729, "clotted": 66309, "spiders": 9036, "Nampo": 181451, "Nampa": 92771, "woody": 51770, "trawling": 24655, "comically": 48133, "spidery": 91990, "canes": 41343, "beautyheaven": 143561, "Fulde": 115294, "Archuleta": 82341, "Kaboul": 24450, "Journey": 22519, "caned": 69502, "Eure": 104348, "Gravesend": 24420, "rumbustious": 177271, "Retreat": 30939, "Euro": 4009, "Valli": 54480, "naturopathic": 117376, "Valle": 13969, "grenadiers": 181508, "pigment": 21858, "Mizell": 146931, "Alya": 89149, "Morten": 34955, "bringing": 2181, "Valls": 18920, "wooded": 12650, "Al-Sidra": 179543, "grueling": 19942, "pipers": 99625, "wooden": 4192, "wholemeal": 35673, "Saco": 85256, "Miers": 96666, "wednesday": 513, "Sack": 49830, "viable": 11637, "LOVEFiLM": 141680, "chameleons": 48272, "Miera": 100719, "Malenchenko": 96215, "Safarova": 54544, "bbqs": 114055, "Pinkerton": 176544, "pizzle": 165680, "snuggles": 50483, "snuggler": 175379,

Keybase proof

I hereby claim:

  • I am aljohri on github.
  • I am aljohri (https://keybase.io/aljohri) on keybase.
  • I have a public key ASCyU9tkT0bjxapcWTiBVdT7EoTbrMpG6saIZ-iPeX-LSQo

To claim this, I am signing this object:

#!/usr/bin/env python2
import re
import json
import requests
import execjs
response = requests.get("https://obamawhitehouse.archives.gov/interactive-budget")
m = re.search(r"//init data(.*)//init TreeMap", response.text, re.S)
js = m.groups()[0].replace('var json = ', '').replace(';', '')
(function() {
function removeQuerySelector(selector) {
var el = document.querySelector(selector);
if (el) el.parentNode.removeChild(el);
}
removeQuerySelector('.header-wrap');
removeQuerySelector('.share-wrap');
removeQuerySelector('#pl_widget-schools');
removeQuerySelector('.pl_widget-contact');
import re
import datetime
import requests
import lxml.html
def strip_within(s):
return re.sub(' +', ' ', s)
def get_nomination(s, congress, number):
url = f"https://www.congress.gov/nomination/{congress}/{number}"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import struct
import sys
import os
import time
# see com.intellij.idea.SocketLock for the server side of this interface
; https://github.com/r0man/sqlingvo/issues/75
(ns my-proj.core
(:gen-class)
(:require [clojure.string :as str]
[sqlingvo.core :as sql]
[sqlingvo.util :refer [sql-quote-backtick]]
[sqlingvo.compiler :refer
[defarity compile-2-ary
compile-fn concat-sql compile-sql-join
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.