def __init__(self, origin, destination):
<EOL>if origin.network_id != destination.network_id:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>origin, origin.network_id, destination, destination.network_id<EOL>)<EOL>)<EOL><DEDENT>if origin.failed:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>origin, destination, origin<EOL>)<EOL>)<EOL><DEDENT>if destination.failed:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>origin, destination, destination<EOL>)<EOL>)<EOL><DEDENT>from dallinger.nodes import Source<EOL>if isinstance(destination, Source):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>".format(destination)<EOL>)<EOL><DEDENT>if origin == destination:<EOL><INDENT>raise ValueError("<STR_LIT>".format(origin))<EOL><DEDENT>self.origin = origin<EOL>self.origin_id = origin.id<EOL>self.destination = destination<EOL>self.destination_id = destination.id<EOL>self.network = origin.network<EOL>self.network_id = origin.network_id<EOL>
Create a vector.