def validate_file(fpath, md5_hash):
hasher = hashlib.md5()<EOL>with open(fpath, '<STR_LIT:rb>') as f:<EOL><INDENT>buf = f.read()<EOL>hasher.update(buf)<EOL><DEDENT>if str(hasher.hexdigest()) == str(md5_hash):<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Validates a file against a MD5 hash

    # Arguments
        fpath: path to the file being validated
        md5_hash: the MD5 hash being validated against

    # Returns
        Whether the file is valid