<s> """<STR_LIT>""" <EOL> import sys <EOL> sys . path . append ( '<STR_LIT:..>' ) <EOL> import urllib2 <EOL> import socket <EOL> import sitemap <EOL> def check_url ( url , timeout = <NUM_LIT:5> ) : <EOL> def_timeout = socket . getdefaulttimeout ( ) <EOL> socket . setdefaulttimeout ( timeout ) <EOL> found = True <EOL> try : <EOL> urllib2 . urlopen ( url ) <EOL> except ( urllib2 . HTTPError , urllib2 . URLError , socket . error , socket . sslerror ) : <EOL> found = False <EOL> socket . setdefaulttimeout ( def_timeout ) <EOL> return found <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> if len ( sys . argv ) != <NUM_LIT:2> : <EOL> print '<STR_LIT>' <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> set = sitemap . UrlSet . from_url ( sys . argv [ <NUM_LIT:1> ] ) <EOL> for url in set : <EOL> if not check_url ( url . loc ) : <EOL> print url . loc </s>
