Spaces:
Sleeping
Sleeping
Download dataset/problem_18/test.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 388 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_18/test.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_18/test.py
-
curl -L -o test.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_18/test.py
388 Bytes
| import unittest | |
| from dataset.problem_18.buggy import moving_average | |
| class TestMovingAverage(unittest.TestCase): | |
| def test_window_3(self): | |
| self.assertEqual(moving_average([1, 2, 3, 4, 5], 3), [2.0, 3.0, 4.0]) | |
| def test_window_larger_than_data(self): | |
| self.assertEqual(moving_average([2, 4], 5), [3.0]) | |
| if __name__ == "__main__": | |
| unittest.main() | |