def md5check(f, ftp, md5, exclude):
files = glob(f)<EOL>if md5 is False:<EOL><INDENT>if len(files) == <NUM_LIT:0>:<EOL><INDENT>return False<EOL><DEDENT>print('<STR_LIT>', f)<EOL>return True<EOL><DEDENT>md5 = '<STR_LIT>' % (ftp.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[<NUM_LIT:0>], md5)<EOL>try:<EOL><INDENT>md5 = pd.read_csv(md5, delim_whitespace = True, names = ['<STR_LIT>', '<STR_LIT:file>'])<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT>md5 = md5[md5['<STR_LIT:file>'].str.endswith(f.rsplit('<STR_LIT:*>', <NUM_LIT:1>)[-<NUM_LIT:1>])]<EOL>md5['<STR_LIT:file>'] = [i.replace('<STR_LIT>', '<STR_LIT>') for i in md5['<STR_LIT:file>']]<EOL>md5 = md5[~md5['<STR_LIT:file>'].str.contains('<STR_LIT:/>')]<EOL>md5 = md5[~md5['<STR_LIT:file>'].str.contains(exclude.replace('<STR_LIT:*>', '<STR_LIT>'))]<EOL>md5['<STR_LIT>'] = [[j for j in calcMD5(i)][<NUM_LIT:0>] for i in md5['<STR_LIT:file>']]<EOL>for i, File in md5.iterrows():<EOL><INDENT>if File['<STR_LIT>'] != File['<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>os.remove(File['<STR_LIT:file>'])<EOL>return False<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>print('<STR_LIT>', f)<EOL>return True<EOL>
* comfirm that downloaded files match md5 checksum on server
* if md5 is False, only check path for the download