def flakes():
    import subprocess, yaml
    popen = subprocess.Popen(['cloc', 'lymph', '--yaml', '--quiet'], stdout=subprocess.PIPE)
    lines = int(yaml.load(popen.stdout)['Python']['code'])
    flakes = int(subprocess.check_output('flake8 lymph | wc -l', shell=True))
    print '%s flakes, %s lines, %.5f flakes per kLOC, one flake every %.1f lines'  % (flakes, lines, 1000 * flakes / lines, lines / flakes)
dataset/ETHPy150Open deliveryhero/lymph/fabfile.py/flakes/original