def compute(self):

        if not self.has_input('Condition'):
            raise ModuleError(self, 'Must set condition')
        cond = self.get_input('Condition')

        if cond:
            port_name = 'TruePort'
            output_ports_name = 'TrueOutputPorts'
        else:
            port_name = 'FalsePort'
            output_ports_name = 'FalseOutputPorts'

        if self.has_input(output_ports_name):
            for connector in self.inputPorts.get(output_ports_name):
                connector.obj.update()

        if not self.has_input(port_name):
            raise ModuleError(self, 'Must set ' + port_name)

        for connector in self.inputPorts.get(port_name):
            connector.obj.update()

            if self.has_input(output_ports_name):
                output_ports = self.get_input(output_ports_name)
                result = []
                for output_port in output_ports:
                    result.append(connector.obj.get_output(output_port))

                # FIXME can we just make this a list?
                if len(output_ports) == 1:
                    self.set_output('Result', result[0])
                else:
                    self.set_output('Result', result)

#################################################################################
## Default module
The compute method for the If module.
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/controlflow/conditional.py/If.compute