def maximum_violation(A_configuration, B_configuration, I, level, extra=None):
P = Probability(A_configuration, B_configuration)<EOL>objective = define_objective_with_I(I, P)<EOL>if extra is None:<EOL><INDENT>extramonomials = []<EOL><DEDENT>else:<EOL><INDENT>extramonomials = P.get_extra_monomials(extra)<EOL><DEDENT>sdpRelaxation = SdpRelaxation(P.get_all_operators(), verbose=<NUM_LIT:0>)<EOL>sdpRelaxation.get_relaxation(level, objective=objective,<EOL>substitutions=P.substitutions,<EOL>extramonomials=extramonomials)<EOL>solve_sdp(sdpRelaxation)<EOL>return sdpRelaxation.primal, sdpRelaxation.dual<EOL>
Get the maximum violation of a two-party Bell inequality.

    :param A_configuration: Measurement settings of Alice.
    :type A_configuration: list of int.
    :param B_configuration: Measurement settings of Bob.
    :type B_configuration: list of int.
    :param I: The I matrix of a Bell inequality in the Collins-Gisin notation.
    :type I: list of list of int.
    :param level: Level of relaxation.
    :type level: int.

    :returns: tuple of primal and dual solutions of the SDP relaxation.