def create_module(base_cls_name, node):
    """create_module(base_cls_name: String, node: TreeNode) -> [ModuleSpec]

    Construct a module spec that inherits from base_cls_name with
    specification from node.

    """
    if node.name in disallowed_modules: return []
    if node.name == 'int': return [] #enum
    def obsolete_class_list():
        lst = []
        items = ['vtkInteractorStyleTrackball',
                 'vtkStructuredPointsGeometryFilter',
                 'vtkConstrainedPointHandleRepresentation',
                 'vtkRenderViewBase',
                 'vtkRenderView']
        def try_to_add_item(item):
            try:
                lst.append(getattr(vtk, item))
            except AttributeError:
                pass
        for item in items:
            try_to_add_item(item)
        return lst

    obsolete_list = obsolete_class_list()

    def is_abstract():
        """is_abstract tries to instantiate the class. If it's
        abstract, this will raise."""
        # Consider obsolete classes abstract
        if node.klass in obsolete_list:
            return True
        try:
            getattr(vtk, node.name)()
        except (TypeError, __HOLE__): # VTK raises type error on abstract classes
            return True
        return False

    try:
        node.klass.__doc__.decode('latin-1')
    except UnicodeDecodeError:
        print "ERROR decoding docstring", node.name
        raise

    input_ports, output_ports = get_ports(node.klass)
    output_ports = list(output_ports) # drop generator

    cacheable = (issubclass(node.klass, vtk.vtkAlgorithm) and
                 (not issubclass(node.klass, vtk.vtkAbstractMapper))) or \
                issubclass(node.klass, vtk.vtkScalarTree)

    is_algorithm = issubclass(node.klass, vtk.vtkAlgorithm)
    tempfile = '_set_tempfile' if issubclass(node.klass, vtk.vtkWriter) else None
    callback = '_set_callback' if is_algorithm else None
    methods_last = hasattr(node.klass, 'SetRenderWindow')

    module_spec = ClassSpec(node.name, base_cls_name, node.name,
                            node.klass.__doc__.decode('latin-1'), callback,
                            tempfile, cacheable, input_ports, output_ports,
                            compute='Update', cleanup='_cleanup',
                            methods_last=methods_last, abstract=is_abstract())

    module_specs = [module_spec]
    for child in node.children:
        if child.name in disallowed_classes:
            continue
        module_specs.extend(create_module(node.name, child))

    return module_specs
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/vtk/vtk_wrapper/parse.py/create_module