<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def q12d_local(vertices, lame, mu):
 """Local stiffness matrix for two dimensional elasticity on a square element. Parameters lame : Float Lame's first parameter mu : Float shear modulus See Also -------- linear_elasticity Notes ----- Vertices should be listed in counter-clockwise order:: [3]----[2] | | | | [0]----[1] Degrees of freedom are enumerated as follows:: [x=6,y=7]----[x=4,y=5] | | | | [x=0,y=1]----[x=2,y=3] """

    M = lame + 2*mu  # P-wave modulus

    R_11 = np.matrix([[2, -2, -1, 1],
                      [-2, 2, 1, -1],
                      [-1, 1, 2, -2],
                      [1, -1, -2, 2]]) / 6.0

    R_12 = np.matrix([[1, 1, -1, -1],
                      [-1, -1, 1, 1],
                      [-1, -1, 1, 1],
                      [1, 1, -1, -1]]) / 4.0

    R_22 = np.matrix([[2, 1, -1, -2],
                      [1, 2, -2, -1],
                      [-1, -2, 2, 1],
                      [-2, -1, 1, 2]]) / 6.0

    F = inv(np.vstack((vertices[1] - vertices[0], vertices[3] - vertices[0])))

    K = np.zeros((8, 8))  # stiffness matrix

    E = F.T * np.matrix([[M, 0], [0, mu]]) * F
    K[0::2, 0::2] = E[0, 0] * R_11 + E[0, 1] * R_12 +\
        E[1, 0] * R_12.T + E[1, 1] * R_22

    E = F.T * np.matrix([[mu, 0], [0, M]]) * F
    K[1::2, 1::2] = E[0, 0] * R_11 + E[0, 1] * R_12 +\
        E[1, 0] * R_12.T + E[1, 1] * R_22

    E = F.T * np.matrix([[0, mu], [lame, 0]]) * F
    K[1::2, 0::2] = E[0, 0] * R_11 + E[0, 1] * R_12 +\
        E[1, 0] * R_12.T + E[1, 1] * R_22

    K[0::2, 1::2] = K[1::2, 0::2].T

    K /= det(F)

    return K