def append_processor(self, proc, source_proc=None):
if source_proc is None and len(self.processors):<EOL><INDENT>source_proc = self.processors[<NUM_LIT:0>]<EOL><DEDENT>if source_proc and not isinstance(source_proc, Processor):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if not isinstance(proc, Processor):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if proc.type == '<STR_LIT>' and len(self.processors):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if source_proc:<EOL><INDENT>for child in self._graph.neighbors_iter(source_proc.uuid()):<EOL><INDENT>child_proc = self._graph.node[child]['<STR_LIT>']<EOL>if proc == child_proc:<EOL><INDENT>proc._uuid = child_proc.uuid()<EOL>proc.process_pipe = self<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if not self._graph.has_node(proc.uuid()):<EOL><INDENT>self.processors.append(proc)  <EOL>self._graph.add_node(proc.uuid(), processor=proc, id=proc.id())<EOL>if source_proc:<EOL><INDENT>self._graph.add_edge(self.processors[<NUM_LIT:0>].uuid(), proc.uuid(),<EOL>type='<STR_LIT>')<EOL><DEDENT>proc.process_pipe = self<EOL>for parent in list(proc.parents.values()):<EOL><INDENT>self._graph.add_edge(parent.uuid(), proc.uuid(),<EOL>type='<STR_LIT>')<EOL><DEDENT><DEDENT>
Append a new processor to the pipe