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 python3 | |
import sys | |
import json | |
from random import random | |
from collections import Counter | |
from collections import defaultdict | |
def normalize(counter): | |
s = float(sum(counter.values())) |
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
[translation:info] 2.7.10 (5.1.2+dfsg-1~16.04, Jun 16 2016, 17:37:42) | |
[PyPy 5.1.2 with GCC 5.3.1 20160413] | |
[platform:msg] Set platform with 'host' cc=None, using cc='gcc', version='Unknown' | |
[translation:info] Translating target as defined by src/tinySelf/target | |
[translation] translate.py configuration: | |
[translation] [translate] | |
targetspec = src/tinySelf/target | |
[translation] translation configuration: | |
[translation] [translation] | |
gc = incminimark |
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 python2 | |
# -*- coding: utf-8 -*- | |
# | |
# Interpreter version: python 2.7 | |
# | |
import sys | |
import sh | |
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
IGNORE: " |\n"; | |
root: (expression ["\."])* expression; | |
object: ["("] slots? sends* [")"]; | |
block: ["["] slots? sends* ["]"]; | |
return: ["^"] expression; | |
expression: IDENTIFIER | value | object | block | send; |
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
def partition(thelist, n): | |
return [ | |
thelist[i:(i + n)] | |
for i in range(0, len(thelist), n) | |
] |
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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Imports ===================================================================== | |
import random | |
# Variables =================================================================== | |
VOWELS = list("aeiouáéíóúůyý") |
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 | |
# -*- coding: utf-8 -*- | |
# | |
# Created: 27.09.13 | |
# | |
# Imports ===================================================================== | |
import ast | |
import types # NoneType | |
import pprint |
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
splitBy: word = (| current <- 0. full_size. out | | |
out: list copy. | |
full_size: self size. | |
full_size <= word size ifTrue: [^out]. | |
word size = 0 ifTrue: [^out]. | |
[current <= full_size] whileTrue: [ | |
self | |
findSubstring: word |
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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Interpreter version: python 2.7 | |
# | |
# Imports ===================================================================== | |
import random | |
# Variables =================================================================== |
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
class Template(object): | |
pass | |
class DescrWrapper(object): | |
def __init__(self, fn): | |
self.fn = fn | |
def __call__(self, *args, **kwargs): | |
return self.fn(self, *args, **kwargs) |
NewerOlder