def sha1sum_url(url):
import hashlib<EOL>import urllib.request, urllib.parse, urllib.error<EOL>from contextlib import closing<EOL>sha1 = hashlib.sha1()<EOL>chunk_size = sha1.block_size * <NUM_LIT><EOL>max_file_size = <NUM_LIT:10> * <NUM_LIT> * <NUM_LIT>  <EOL>total_read = <NUM_LIT:0><EOL>with closing(urllib.request.urlopen(url)) as url_obj:<EOL><INDENT>for chunk in iter(lambda: url_obj.read(chunk_size), b'<STR_LIT>'):<EOL><INDENT>sha1.update(chunk)<EOL>total_read += chunk_size<EOL>if total_read > max_file_size:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>return sha1.hexdigest()<EOL>
Return the secure hash digest with sha1 algorithm for a given url

    >>> url = "https://github.com/yomguy/timeside-samples/raw/master/samples/guitar.wav"
    >>> print sha1sum_url(url)
    08301c3f9a8d60926f31e253825cc74263e52ad1