def create_message(self, previousTemplates, previousFields, next_template):
        """ Craft a message according to previous templates
        and new selected template.
        """
        transition = self.generateTransitionLabel(previousTemplates,
                                                  next_template)
        # we fill the ids according to neg. index
        # in the transitions, for instance:
        # 23;12;15
        # -3 -2 -1
        # so "-1" is the current message, -2 the previous message and so on.
        fields = dict(zip([str(ind) for ind in range(1--len(previousFields),
                                                     -1)], previousFields))
        # Find rules matching current transition
        if transition not in self.rules:
            if not next_template.has_fields():
                current_rules = []
            else:
                return (None, None, None)
        else:
            current_rules = self.rules[transition]
        # Find new fields content according to rules
        dst_fields = {}
        # this is a bit sick... model.py generates the rules in the right
        # sequence, such that all fields in the current message are already
        #filled, if their values are referenced by rules; i.e. we can just
        #add a reference to dst_fields as the "-1" (=current) fields
        fields["-1"] = dst_fields
        for rule in current_rules:
            src_id = rule.src_id
            dst = rule.dst_field
            src = rule.src_field
            if rule.typ == "rule.ExactRule":
                dst_fields[dst] = fields[src_id][src]
                continue
            if rule.typ == "rule.DataRule":
                dst_fields[dst] = random.choice(rule.data[5:].split(","))
                continue
            if rule.typ == "rule.CopyCompleteRule":
                # Copy the exact content of a field 
                if rule.data[6:20] == "COPY_AS_PREFIX":
                    dst_fields[dst] = fields[src_id][src]+random.choice(rule.data[26:].split(","))
                else:
                    dst_fields[dst] = random.choice(rule.data[26:].split(","))+fields[src_id][src]
                continue
            if rule.typ == "rule.CopyPartialRule":
                # Copy the front or back part of a field splitted
                # by a separator s
                split_data = fields[src_id][src].split(rule.data[26:], 1)
                if rule.data[6:20] == "COPY_THE_PREFIX":
                    if len(split_data) == 2:
                        dst_fields[dst] = split_data[0]
                    else:
                        # we could not split the data with the seperator...
                        # ... so we cannot enter anything at this point
                        dst_fields[dst] = ""
                else:
                    if len(split_data) == 2:
                        dst_fields[dst] = split_data[1]
                    else:
                        # we could not split the data with the seperator...
                        # ... so we cannot enter anything at this point
                        dst_fields[dst] = ""
                continue
            if rule.typ == "rule.SeqRule":
                try:
                    dst_fields[dst] = int(fields[src_id][src])+int(rule.data[5:])
                except:
                    dst_fields[dst] = 0
                continue

        # Fill new template fields with new content
        message = next_template.fillFields(dst_fields)
        fields = dst_fields.items()
        fields.sort(key=operator.itemgetter(0))
        msg = urllib.unquote(''.join(str(n) for n in message))
        return (msg, [f[1] for f in fields], transition)
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/lens.py/RuleList.create_message/swapped operands of `-`