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
from collections import defaultdict | |
def detect_language(scores, input_str): | |
tokens = input_str.split() | |
results = defaultdict(int) | |
for token in tokens: | |
if token in scores: | |
language, score = scores[token][0] | |
results[language] += score | |
max_lang, max_score = max(results.items(), key=lambda x:x[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
_up () { | |
compadd $(up -h|grep " "|tr -s " "|tr "," "\n"|sed -E "s/ ([a-zA-Z-]+)[ ,].*/\1/") | |
_arguments -s "*:files:_files" | |
} | |
compdef _up up |
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 python | |
import sys | |
from electrum import Interface | |
from electrum import bitcoin, Transaction | |
def get_transactions(addr): | |
interface = Interface({'server':'electrum.be:50001:t'}) | |
interface.start() |
NewerOlder