def run(self):
random.seed(self.seed)<EOL>np.random.seed(self.np_seed)<EOL>if not isinstance(self, multiprocessing.Process):<EOL><INDENT>mx.random.seed(self.mx_seed)<EOL><DEDENT>try:<EOL><INDENT>stream_iter = iter(self.stream)<EOL>self._errorq.put(None)<EOL><DEDENT>except Exception as e:  <EOL><INDENT>tb = traceback.format_exc()<EOL>self._errorq.put((e, tb))<EOL><DEDENT>while True:<EOL><INDENT>try:  <EOL><INDENT>c = self._controlq.get(False)<EOL>if c is None:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'.format(repr(c)))<EOL><DEDENT><DEDENT>except queue.Empty:<EOL><INDENT>pass<EOL><DEDENT>except RuntimeError as e:<EOL><INDENT>tb = traceback.format_exc()<EOL>self._errorq.put((e, tb))<EOL>self._dataq.put(None)<EOL><DEDENT>try:<EOL><INDENT>data = next(stream_iter)<EOL>error = None<EOL><DEDENT>except Exception as e:  <EOL><INDENT>tb = traceback.format_exc()<EOL>error = (e, tb)<EOL>data = None<EOL><DEDENT>finally:<EOL><INDENT>self._errorq.put(error)<EOL>self._dataq.put(data)<EOL><DEDENT><DEDENT>
Method representing the process’s activity.