Download 167/solution/_reference.py from PRHW/loom-benchmark-mbpp: direct link, hf CLI and curl.
- Browser
- Download file 146 Bytes
-
https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/167/solution/_reference.py
- Command line
-
hf download hf://datasets/PRHW/loom-benchmark-mbpp/167/solution/_reference.py
-
curl -L -o _reference.py https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/167/solution/_reference.py
146 Bytes
| def next_power_of_2(n): | |
| if n and not n & (n - 1): | |
| return n | |
| count = 0 | |
| while n != 0: | |
| n >>= 1 | |
| count += 1 | |
| return 1 << count; |