could be replaced with
```python
from gzip import open as gz_open
from os.path import splitext
with gz_open(f, 'rb') as gz_file, open(splitext(f)[0], 'w') as outfile:
     chunk = gz_file.read(1000)
    while chunk:
        outfile.write(chunk)
        chunk = gz_file.read(1000)
```