def check_amplification(dstore):
    """
    Make sure the amplification codes in the site collection match the
    ones in the amplification table
    """
    codeset = set(dstore['amplification']['ampcode'])
    if len(codeset) == 1:
        return
    codes = set(dstore['sitecol'].ampcode)
    missing = codes - codeset
    if missing:
        raise ValueError(
            'The site collection contains references to missing amplification functions: %s'
             % b' '.join(missing).decode('utf8'))
