

def compute(self):
    args = []
    if (not self.has_input('dataset')):
        raise ModuleError(self, "'dataset' is mandatory.")
    if (not self.has_input('plot')):
        raise ModuleError(self, "'plot' is mandatory.")
    dataset = self.get_input('dataset')
    plotType = self.get_input('plot')
    axes = self.force_get_input('axes')
    inCanvas = self.force_get_input('canvas')
    if (axes != None):
        try:
            kwargs = eval(axes)
        except:
            raise ModuleError(self, "Invalid 'axes' specification", axes)
        dataset = dataset(**kwargs)
    outCanvas = None
    if (inCanvas != None):
        inCanvas.plot(dataset, 'ASD', plotType)
        outCanvas = inCanvas
    else:
        ev = DisplayCellEvent()
        ev.vistrail = {
            'locator': None,
            'version': (- 1),
            'actions': [],
        }
        ev.cellType = QCDATWidget
        ev.inputPorts = (dataset, 'ASD', plotType)
        QtCore.QCoreApplication.processEvents()
        spreadsheetWindow = spreadsheetController.findSpreadsheetWindow()
        cdatWidget = spreadsheetWindow.displayCellEvent(ev)
        if (cdatWidget != None):
            outCanvas = cdatWidget.canvas
    self.set_output('dataset', dataset)
    self.set_output('canvas', outCanvas)

dataset/ETHPy150Open VisTrails/VisTrails/contrib/cdat/quickplot.py quickplot.compute/original