def get_name_and_checksum(checksums, end):
    """Extract a full filename and checksum from the checksums list for a file ending in given end."""
    for entry in checksums:
        if not entry['file'].endswith(end):
            continue
        if '_from_' not in end and '_from_' in entry['file']:
            continue
        filename = entry['file']
        expected_checksum = entry['checksum']
        return filename, expected_checksum
    raise ValueError('No entry for file ending in {!r}'.format(end))
