| 1 | #!/usr/bin/env python2 |
| 2 | from __future__ import print_function |
| 3 | |
| 4 | import os |
| 5 | from mycpp.mylib import log |
| 6 | |
| 7 | |
| 8 | def f(s): |
| 9 | # type: (str) -> str |
| 10 | return s[1].upper() |
| 11 | |
| 12 | |
| 13 | def run_tests(): |
| 14 | # type: () -> None |
| 15 | |
| 16 | #a = 'foo' + 'bar' |
| 17 | a = 'food' |
| 18 | print(a.upper()) |
| 19 | |
| 20 | print(f(a)) |
| 21 | |
| 22 | |
| 23 | def run_benchmarks(): |
| 24 | # type: () -> None |
| 25 | pass |
| 26 | |
| 27 | |
| 28 | if __name__ == '__main__': |
| 29 | if os.getenv('BENCHMARK'): |
| 30 | log('Benchmarking...') |
| 31 | run_benchmarks() |
| 32 | else: |
| 33 | run_tests() |