def calculate_acwl(code, verbose = False):
    """
        Calculate the average code word length of a code passed
        in as a csv with the symbols in column 0 and codewords in col 1.
    """
    cwlsum = 0
    for symbol in code:
        cwlsum += len(code[symbol])
    code_size = len(code)

    if verbose:
        print("CWL Sum: %d" %cwlsum)
        print("Code Size: %d" %code_size)

    return (float(cwlsum)/float(code_size))