Open AhmedSeemalK opened 6 months ago
[!TIP] I can email you next time I complete a pull request if you set up your email
The sandbox appears to be unavailable or down.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sliding_window.py
✓ https://github.com/psurabh/build_tools/commit/00996b2cdfb1588269696e6eb7f4452f692c95ba Edit
Create sliding_window.py with contents:
• Start by creating a new Python file named `sliding_window.py`.
• In this file, define a function named `sliding_window` that takes two parameters: `array` and `window_size`.
• Inside the function, initialize an empty list named `subarrays`.
• Then, create a for loop that iterates over the `array` using an index. The loop should start at 0 and end at `len(array) - window_size + 1`, so that it does not go out of bounds when creating subarrays.
• Inside the loop, use slicing to create a subarray from the current index to the current index plus `window_size`. Add this subarray to `subarrays`.
• After the loop, return `subarrays`.
• Finally, add a main block that tests the `sliding_window` function with some example arrays and window sizes, and prints the results.
sliding_window.py
✓ Edit
Check sliding_window.py with contents:
Ran GitHub Actions for 00996b2cdfb1588269696e6eb7f4452f692c95ba:
I have finished reviewing the code for completeness. I did not find errors for sweep/write_a_sliding_window_program_in_python
.
💡 To recreate the pull request edit the issue title or description.Something wrong? [Let us know].
This is an automated message generated by Mi6
Checklist
- [X] Create `sliding_window.py` ✓ https://github.com/psurabh/build_tools/commit/00996b2cdfb1588269696e6eb7f4452f692c95ba [Edit](https://github.com/psurabh/build_tools/edit/sweep/write_a_sliding_window_program_in_python/sliding_window.py) - [X] Running GitHub Actions for `sliding_window.py` ✓ [Edit](https://github.com/psurabh/build_tools/edit/sweep/write_a_sliding_window_program_in_python/sliding_window.py)