def compute(self):
        vtk_object = None
        if self.has_input("SetInputConnection0"):
            ic = self.get_input("SetInputConnection0")
            port_object = ic.vtkInstance
            ix = port_object.GetIndex()
            producer = port_object.GetProducer()
            try:
                vtk_object = producer.GetOutput()
            except __HOLE__:
                raise ModuleError(self, 
                                  "expected a module that supports GetOutput")
        elif self.has_input("SetInput"):
            port_object = self.get_input("SetInput")
            if hasattr(port_object, "vtkInstance"):
                vtk_object = port_object.vtkInstance
            else:
                raise ModuleError(self, "expected a vtk module")
        if vtk_object:
            self.auto_set_results(vtk_object)
dataset/ETHPy150Open VisTrails/VisTrails/contrib/vtksnl/inspectors.py/vtkPolyDataInspector.compute