]> git.proxmox.com Git - ceph.git/blame - ceph/src/s3select/example/expr_genrator.py
import quincy beta 17.1.0
[ceph.git] / ceph / src / s3select / example / expr_genrator.py
CommitLineData
f67539c2
TL
1import random
2import sys
3
4def expr(depth):
5 if depth==1 or random.random()<1.0/(2**depth-1):
6 return str(int(random.random() * 100) + 1)+".0"
7 return '(' + expr(depth-1) + random.choice(['+','-','*','/']) + expr(depth-1) + ')'
8
20effc67 9print (expr( int(sys.argv[1]) ))