This file contains hidden or 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 re import match as _m | |
calcule=(lambda n,machine='machi' | |
'ne-1': ( lambda m:(lambda | |
f:(lambda x: x(x))(lambda | |
x:f(lambda v: (x(x ))(v))))( | |
lambda f:lambda x:(lambda r:r | |
.group(1) if r else m[1][x[ | |
0]](f(x[1:])) )(_m(m[0],x) | |
))(n) if _m( r'[{}]*{}'. | |
format( ''. join(m[1]) |
This file contains hidden or 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 functools import reduce | |
import re | |
_TYPES = {'string': str, 'int': int, 'object': dict, 'array': list, | |
'bool': bool, 'null': type(None)} | |
_OPS = {'$eq': lambda s, d: s == d, | |
'$gt': lambda s, d: d > s, | |
'$gte': lambda s, d: d >= s, |
NewerOlder