def __init__(self, *args, **kwargs):
self.n_parties = len(args)<EOL>self.parties = []<EOL>self.labels = [chr(ord('<STR_LIT:A>') + i) for i in range(self.n_parties)]<EOL>for name, value in kwargs.items():<EOL><INDENT>if name == "<STR_LIT>":<EOL><INDENT>if len(value) != self.n_parties:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>self.labels = value<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" + name)<EOL><DEDENT><DEDENT>for i, configuration in enumerate(args):<EOL><INDENT>self.parties.append(generate_measurements(configuration,<EOL>self.labels[i]))<EOL><DEDENT>self.substitutions = projective_measurement_constraints(self.parties)<EOL>
Class for working with quantum probabilities.

        :param *args: Input configurations for each parties
        :type *args: tuple of list of lists
        :param labels: Optional parameter string to define the label of each
                       party.
        :type labels: list of str.
        :Example:

        For a CHSH scenario, instantiate the class as

            P = Probability([2, 2], [2, 2])