<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lambda_B_calc(classes, table, TOP, POP):
 """ Calculate Goodman and Kruskal's lambda B. :param classes: confusion matrix classes :type classes : list :param table: confusion matrix table :type table : dict :param TOP: test outcome positive :type TOP : dict :param POP: population :type POP : int :return: Goodman and Kruskal's lambda B as float """

    try:
        result = 0
        length = POP
        maxresponse = max(list(TOP.values()))
        for i in classes:
            result += max(list(table[i].values()))
        result = (result - maxresponse) / (length - maxresponse)
        return result
    except Exception:
        return "None"