def get_custom_ports(cls):
    input_ports = []
    output_ports = []

    if cls == vtk.vtkAlgorithm:
        ps = InputPortSpec(name='AddInputConnection',
                           port_type='vtkAlgorithmOutput',
                           show_port=True,
                           docstring='Adds an input connection',
                           depth=1)
        input_ports.append(ps)
    # vtkWriters have a custom File port
    if cls in [vtk.vtkWriter, vtk.vtkImageWriter]:
        ps = OutputPortSpec(name='file',
                            port_type='basic:File',
                            show_port=True,
                            docstring='The written file')
        output_ports.append(ps)
    elif cls == vtk.vtkVolumeProperty:
        ps = InputPortSpec(name='TransferFunction',
                           method_name='SetTransferFunction',
                           port_type='TransferFunction',
                           docstring='Sets the transfer function to use')
        input_ports.append(ps)
    elif cls == vtk.vtkDataSet:
        ps = InputPortSpec(name='SetPointData',
                           method_name='PointData',
                           port_type='vtkPointData',
                           show_port=True,
                           docstring='Sets the point data')
        input_ports.append(ps)
        ps = InputPortSpec(name='SetCellData',
                           method_name='CellData',
                           port_type='vtkCellData',
                           show_port=True,
                           docstring='Sets the cell data')
        input_ports.append(ps)
    elif cls==vtk.vtkCell:
        ps = InputPortSpec(name='SetPointIds',
                           method_name='PointIds',
                           port_type='vtkIdList',
                           show_port=True,
                           docstring='Sets the point id list')
        input_ports.append(ps)
    elif cls==vtk.vtkMultiBlockPLOT3DReader:
        ps = OutputPortSpec(name='StructuredGrid',
                            method_name='FirstBlock',
                            port_type='vtkStructuredGrid',
                            show_port=True,
                            docstring='Returns .GetOutput().GetBlock(0)')
        output_ports.append(ps)

    return input_ports, output_ports
Add new layers on top of the existing hidden layers
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/vtk/vtk_wrapper/parse.py/get_custom_ports--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/dbm/dbm.py/DBM.add_layers