def multiply(self, a, b):
if a is None or b is None: return None<EOL>m, n, l = len(a), len(b[<NUM_LIT:0>]), len(b[<NUM_LIT:0>])<EOL>if len(b) != n:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>c = [[<NUM_LIT:0> for _ in range(l)] for _ in range(m)]<EOL>for i, row in enumerate(a):<EOL><INDENT>for k, eleA in enumerate(row):<EOL><INDENT>if eleA:<EOL><INDENT>for j, eleB in enumerate(b[k]):<EOL><INDENT>if eleB: c[i][j] += eleA * eleB<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return c<EOL>
:type A: List[List[int]]
:type B: List[List[int]]
:rtype: List[List[int]]