I hereby claim:
- I am mazieres on github.
- I am mazieres (https://keybase.io/mazieres) on keybase.
- I have a public key ASDzCRM2QkTnZ8Im0Yw210zPZZ54GykPj9xwJ6gw6bki0Qo
To claim this, I am signing this object:
# dict of conversion of google's charset to python codec name | |
enc_google_to_python = { | |
"windows-1257": "cp1257", | |
"GB2312 ": "gb2312", | |
"windows-874": "cp874", | |
"EUC-KR": "euc_kr", | |
"Shift_JIS": "shift_jis", | |
"UTF-8": "utf_8", | |
"ISO-8859-2": "iso8859_2", | |
"ISO-8859-9": "iso8859_9", |
package main | |
import ( | |
"bufio" | |
"encoding/csv" | |
"errors" | |
"fmt" | |
"io" | |
"log" | |
"os" |
function mkAllQueries(query) { | |
var allRes = {} | |
var promises = [] | |
for (var i = 0; i < nb_hls; i++){ | |
promises.push($.getJSON(apiUrl, { | |
"client": "firefox", | |
"hl": hls[i], | |
"q": query | |
}) | |
.done(function (hl, q) { |
import json | |
from json.decoder import WHITESPACE | |
def iterload(string, cls=json.JSONDecoder, **kwargs): | |
decoder = cls(**kwargs) | |
idx = WHITESPACE.match(string, 0).end() | |
while idx < len(string): | |
try: | |
obj, end = decoder.raw_decode(string, idx) | |
idx = WHITESPACE.match(string, end).end() |
I hereby claim:
To claim this, I am signing this object:
import progressbar | |
i = 0 | |
with progressbar.ProgressBar(max_value=len(entities)) as bar: | |
for entity in entities: | |
compute_metrics(entity) | |
i += 1 | |
bar.update(i) |
def flatten(li): | |
return [item for sublist in li for item in sublist] |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
import subprocess | |
def cli(cmd_str): | |
process = subprocess.Popen(cmd_str, stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE, shell=True) | |
output, error = process.communicate() | |
output, error = [x if len(x) > 0 else None | |
for x in (output.decode().strip(), error.decode().strip())] |