<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_L(A):
 """ Calculate the Leontief L from A Parameters A : pandas.DataFrame or numpy.array Symmetric input output table (coefficients) Returns ------- pandas.DataFrame or numpy.array Leontief input output table L The type is determined by the type of A. If DataFrame index/columns as A """

    I = np.eye(A.shape[0])   # noqa
    if type(A) is pd.DataFrame:
        return pd.DataFrame(np.linalg.inv(I-A),
                            index=A.index, columns=A.columns)
    else:
        return np.linalg.inv(I-A)