def get_get_set_ports(cls, get_set_dict):
    """get_get_set_ports(cls: class, get_set_dict: dict) -> None
    Convert all Setxxx methods of cls into input ports and all Getxxx
    methods of module into output ports

    Keyword arguments:
    cls          --- class
    get_set_dict --- the Set/Get method signatures returned by vtk_parser

    """

    input_ports = []
    output_ports = []
    for name in get_set_dict:
        if name in disallowed_get_set_ports:
            continue
        getter_name = 'Get%s' % name
        setter_name = 'Set%s' % name
        getter_method = getattr(cls, getter_name)
        setter_method = getattr(cls, setter_name)
        getter_sig = parser.get_method_signature(getter_method)
        setter_sig = parser.get_method_signature(setter_method)
        if len(getter_sig) > 1:
            prune_signatures(cls, getter_name, getter_sig, output=True)
        for order, getter in enumerate(getter_sig):
            if getter[1]:
                #print ("Can't handle getter %s (%s) of class %s: Needs input "
                #       "to get output" % (order+1, name, cls.__name__))
                continue
            if len(getter[0]) != 1:
                #print ("Can't handle getter %s (%s) of class %s: More than a "
                #       "single output" % (order+1, name, cls.__name__))
                continue
            port_type = get_port_types(getter[0][0])
            if is_type_allowed(port_type):
                if name in color_ports:
                    ps = OutputPortSpec(name=name,
                                        method_name=getter_name,
                                        port_type="basic:Color",
                                        show_port=False,
                                        docstring=get_doc(cls, getter_name))
                    input_ports.append(ps)
                else:
                    ps = OutputPortSpec(name=name,
                                        method_name=getter_name,
                                        port_type=port_type,
                                        show_port=False,
                                        docstring=get_doc(cls, getter_name))
                    output_ports.append(ps)

        if len(setter_sig) > 1:
            prune_signatures(cls, setter_name, setter_sig)
        docstring = get_doc(cls, setter_name)
        v = vtk.vtkVersion()
        version = [v.GetVTKMajorVersion(),
                   v.GetVTKMinorVersion(),
                   v.GetVTKBuildVersion()]
        if version < [6, 0, 0]:
            # Always use VTK6-style names for InputData-style types
            setter_name = get_vtk6_name(cls, setter_name)
            name = setter_name[3:]
        for ix, setter in enumerate(setter_sig):
            if setter[1] is None:
                continue

            # Wrap SetFileNames for VisTrails file access
            # FIXME add documentation
            if file_name_pattern.match(name):
                ps = InputPortSpec(name=name[:-4],
                                   method_name=setter_name,
                                   port_type="basic:File",
                                   show_port=True)
                input_ports.append(ps)
            # Wrap color methods for VisTrails GUI facilities
            # FIXME add documentation
            elif name in color_ports:
                ps = InputPortSpec(name=name,
                                   method_name=setter_name,
                                   port_type="basic:Color",
                                   show_port=False)
                input_ports.append(ps)
            # Wrap SetRenderWindow for exporters
            # FIXME Add documentation
            elif name == 'RenderWindow' and cls == vtk.vtkExporter:
                ps = InputPortSpec(name="vtkRenderer",
                                   port_type="vtkRenderer",
                                   show_port=True)
                input_ports.append(ps)
            else:
                n = resolve_overloaded_name(name, ix, setter_sig)
                port_types = get_port_types(setter[1])
                if is_type_allowed(port_types):
                    if len(setter[1]) == 1:
                        show_port = True
                        try:
                            show_port = port_types[0] not in type_map_values
                        except __HOLE__: # hash error
                            pass
                        port_types = port_types[0]
                    else:
                        show_port = False
                    ps = InputPortSpec(name=n,
                                       method_name=setter_name,
                                       port_type=port_types,
                                       show_port=show_port,
                                       docstring=docstring,
                                       depth=1)
                    input_ports.append(ps)

    return input_ports, output_ports
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/vtk/vtk_wrapper/parse.py/get_get_set_ports