def format_multimatches(self, caller, matches):
        """
        Format multiple command matches to a useful error.

        This is copied directly from the default method in
        evennia.commands.cmdhandler.

        """
        string = "There were multiple matches:"
        for num, match in enumerate(matches):
            # each match is a tuple (candidate, cmd)
            candidate, cmd = match

            is_channel = hasattr(cmd, "is_channel") and cmd.is_channel
            if is_channel:
                is_channel = " (channel)"
            else:
                is_channel = ""
            is_exit = hasattr(cmd, "is_exit") and cmd.is_exit
            if is_exit and cmd.destination:
                is_exit = " (exit to %s)" % cmd.destination
            else:
                is_exit = ""

            id1 = ""
            id2 = ""
            if not (is_channel or is_exit) and (hasattr(cmd, 'obj') and cmd.obj != caller):
                # the command is defined on some other object
                id1 = "%s-" % cmd.obj.name
                id2 = " (%s-%s)" % (num + 1, candidate.cmdname)
            else:
                id1 = "%s-" % (num + 1)
                id2 = ""
            string += "\n  %s%s%s%s%s" % (id1, candidate.cmdname, id2, is_channel, is_exit)
        return string
dataset/ETHPy150Open evennia/evennia/evennia/commands/default/syscommands.py/SystemMultimatch.format_multimatches/original