def check_block(table, block_struct):
    """A function used to check whether a given codon table conforms
    to the given block structure

    Parameters
    ----------
        dict table: a python dict representing the codon table
        dict block_struct: a python dict representing the table block structure

    Returns
    -------
    bool valid: true->table conforms to block structure; false otherwise
    """
    # loop over codons in each block; return false if they code for
    # different residues
    for codon_list in block_struct.values():
        # initialize set of residues that a block codes for and populate
        block_residues = set()
        for codon in codon_list:
            block_residues.add(table[codon])
        # return false if the set is more than one element long
        if len(block_residues) > 1:
            return False
    # if function reaches this point, return True
    return True