def transmit(self, what=None, to_whom=None):
whats = set()<EOL>for what in self.flatten([what]):<EOL><INDENT>if what is None:<EOL><INDENT>what = self._what()<EOL><DEDENT>if inspect.isclass(what) and issubclass(what, Info):<EOL><INDENT>whats.update(self.infos(type=what))<EOL><DEDENT>else:<EOL><INDENT>whats.add(what)<EOL><DEDENT><DEDENT>to_whoms = set()<EOL>for to_whom in self.flatten([to_whom]):<EOL><INDENT>if to_whom is None:<EOL><INDENT>to_whom = self._to_whom()<EOL><DEDENT>if inspect.isclass(to_whom) and issubclass(to_whom, Node):<EOL><INDENT>to_whoms.update(self.neighbors(direction="<STR_LIT:to>", type=to_whom))<EOL><DEDENT>else:<EOL><INDENT>to_whoms.add(to_whom)<EOL><DEDENT><DEDENT>transmissions = []<EOL>vectors = self.vectors(direction="<STR_LIT>")<EOL>for what in whats:<EOL><INDENT>for to_whom in to_whoms:<EOL><INDENT>try:<EOL><INDENT>vector = [v for v in vectors if v.destination_id == to_whom.id][<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(self, to_whom)<EOL>)<EOL><DEDENT>t = Transmission(info=what, vector=vector)<EOL>transmissions.append(t)<EOL><DEDENT><DEDENT>return transmissions<EOL>
Transmit one or more infos from one node to another.

        "what" dictates which infos are sent, it can be:
            (1) None (in which case the node's _what method is called).
            (2) an Info (in which case the node transmits the info)
            (3) a subclass of Info (in which case the node transmits all
                its infos of that type)
            (4) a list of any combination of the above
        "to_whom" dictates which node(s) the infos are sent to, it can be:
            (1) None (in which case the node's _to_whom method is called)
            (2) a Node (in which case the node transmits to that node)
            (3) a subclass of Node (in which case the node transmits to all
                nodes of that type it is connected to)
            (4) a list of any combination of the above
        Will additionally raise an error if:
            (1) _what() or _to_whom() returns None or a list containing None.
            (2) what is/contains an info that does not originate from the
                transmitting node
            (3) to_whom is/contains a node that the transmitting node does not
                have a not-failed connection with.