self.f = self.user_function(**inputs)
        try:
            outputs = self.f.send(inputs)
        except StopIteration:
            self.terminate()

def block_code(self):
        inputs = self._get_all_input_values()
        outputs = {}
        """
        self.f = self.user_function(**inputs)
        try:
            outputs = self.f.send(inputs)
        except StopIteration:
            self.terminate()
        """
        if self.first_time:
            self.f = self.user_function(**inputs)
            outputs = self.f.next()
            self.first_time = False
        else:
            try:
                outputs = self.f.send(inputs)
            except StopIteration:
                self.terminate()

        if outputs:
            for key in outputs.keys():
                self.set_output_data(key, outputs[key])
        if 'previous_outputs' in self.output_channels.keys():
            self.output_channels['previous_outputs'].set_value(Data(self.time, copy.deepcopy(outputs)))