While I was trying to use the code, the chmod command did not work on windows. After a bit of searching, the following commands work fine and I was able to successfully download the required folder from a repo.
$ icacls getFolderFromRepo.py
$ python getFoldeFromRepo.py [github-url-of-required-repo]
Suggesting to make a change in the documentation for potential Windows users!