doc comments for better code

This commit is contained in:
Hamad alghanim
2017-10-17 01:38:16 -07:00
parent 3729c635f8
commit f023aba0bd
+2
View File
@@ -916,10 +916,12 @@ def find_requirements(max_depth=3):
raise RuntimeError('No requirements.txt found!')
def is_valid_url(url):
"""Checks if a given string is an url"""
pieces = urlparse(url)
return all([pieces.scheme, pieces.netloc])
def download_file(url, filename):
"""Downloads file from url to a path with filename"""
r = requests.get(url, stream=True)
if not r.ok:
raise IOError('Unable to download file')