Skip to content

Instantly share code, notes, and snippets.

View mocking_and_caching_results_in_recursion.py
import requests
import requests_mock
import requests_cache
with requests_mock.mock() as mock:
mock.get("mock://test", text="test")
requests_cache.install_cache("test_cache", backend="memory")
requests.get("mock://test")
# -> RecursionError: maximum recursion depth exceeded
@1kastner
1kastner / fixing_script.py
Created Dec 27, 2015
In case you needed to abort the downloads because of an unstable connection
View fixing_script.py
import os
import os.path
import re
import shutil
DB_BASE = "/home/marvin/projectrepository/AudioFiles/voxforge"
for f in os.listdir("."):
match = re.match("(.*)\.tgz.[0-9]", f)
if match:
View download_and_untar.sh
# Elie Khoury <Elie.Khoury@idiap.ch>
# Date: Thu Aug 22 18:17:29 CEST 2013
#
# Copyright (C) 2012-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
You can’t perform that action at this time.