<s> import os <EOL> try : <EOL> from urllib import urlretrieve <EOL> except ImportError : <EOL> from urllib . request import urlretrieve <EOL> def check_destination_path ( path , name , overwrite = False ) : <EOL> """<STR_LIT>""" <EOL> file_path = os . path . join ( path , name ) <EOL> if not os . path . isdir ( path ) : <EOL> raise IOError ( <EOL> '<STR_LIT>' . format ( path ) ) <EOL> if os . path . exists ( file_path ) and not overwrite : <EOL> raise IOError ( '<STR_LIT>' . format ( name , path ) ) <EOL> return file_path </s>
