def verify(info, directory_path):
base_path = os.path.join(directory_path, info['<STR_LIT:name>'])<EOL>if '<STR_LIT>' in info:<EOL><INDENT>if os.stat(base_path).st_size != info['<STR_LIT>']:<EOL><INDENT>return False<EOL><DEDENT>getfile = lambda: open(base_path, '<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>assert '<STR_LIT>' in info, '<STR_LIT>'<EOL>for f in info['<STR_LIT>']:<EOL><INDENT>p = os.path.join(base_path, *f['<STR_LIT:path>'])<EOL>if os.stat(p).st_size != f['<STR_LIT>']:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>getfile = lambda: ConcatenatedFile(base_path, info['<STR_LIT>'])<EOL><DEDENT>with getfile() as f:<EOL><INDENT>return compare_checksum(info, f)<EOL><DEDENT>
Return True if the checksum values in the torrent file match the
    computed checksum values of downloaded file(s) in the directory and if
    each file has the correct length as specified in the torrent file.