def solve_with_cvxpy(sdp, solverparameters=None):
problem = convert_to_cvxpy(sdp)<EOL>if solverparameters is not None and '<STR_LIT>' in solverparameters:<EOL><INDENT>solver = solverparameters.pop('<STR_LIT>')<EOL>v = problem.solve(solver=solver, verbose=(sdp.verbose > <NUM_LIT:0>))<EOL><DEDENT>else:<EOL><INDENT>v = problem.solve(verbose=(sdp.verbose > <NUM_LIT:0>))<EOL><DEDENT>if v is None:<EOL><INDENT>status = "<STR_LIT>"<EOL>x_mat, y_mat = [], []<EOL><DEDENT>elif v == float("<STR_LIT>") or v == -float("<STR_LIT>"):<EOL><INDENT>status = "<STR_LIT>"<EOL>x_mat, y_mat = [], []<EOL><DEDENT>else:<EOL><INDENT>status = "<STR_LIT>"<EOL>x_pre = sdp.F[:, <NUM_LIT:1>:sdp.n_vars+<NUM_LIT:1>].dot(problem.variables()[<NUM_LIT:0>].value)<EOL>x_pre += sdp.F[:, <NUM_LIT:0>]<EOL>row_offsets = [<NUM_LIT:0>]<EOL>cumulative_sum = <NUM_LIT:0><EOL>for block_size in sdp.block_struct:<EOL><INDENT>cumulative_sum += block_size ** <NUM_LIT:2><EOL>row_offsets.append(cumulative_sum)<EOL><DEDENT>x_mat = []<EOL>for bi, bs in enumerate(sdp.block_struct):<EOL><INDENT>x = x_pre[row_offsets[bi]:row_offsets[bi+<NUM_LIT:1>]].reshape((bs, bs))<EOL>x += x.T - np.diag(np.array(x.diagonal())[<NUM_LIT:0>])<EOL>x_mat.append(x)<EOL><DEDENT>y_mat = [constraint.dual_value for constraint in problem.constraints]<EOL><DEDENT>return v+sdp.constant_term, v+sdp.constant_term, x_mat, y_mat, status<EOL>
Helper function to convert the SDP problem to CVXPY
    and call the solver, and parse the output.

    :param sdp: The SDP relaxation to be solved.
    :type sdp: :class:`ncpol2sdpa.sdp`.