We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
invalid keyword argument 'range'
testing on Windows Qt5.5.1/ PyQtgraph github of 20160102, I have the following error on the "Custom Flowchart Nodes" test:

```
Using PyQt5 (default graphics system)
QWindowsWindow::setGeometryDp: Unable to set geometry 600x900+480+210 on QWidget
Window/'QMainWindowClassWindow'. Resulting geometry:  600x874+480+210 (frame: 8,
 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 69x69, maximum size: 1677721
5x16777215).
Using PyQt5 (default graphics system)
D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64\lib\sit
e-packages\pyqtgraph\flowchart\eq.py:11: FutureWarning: comparison to `None` wil
l result in an elementwise object comparison in the future.
  e = a==b
Traceback (most recent call last):
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\examples\FlowchartCustomNode.py", line 147, in <mod
ule>
    fNode = fc.createNode('UnsharpMask', pos=(0, 0))
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\flowchart\Flowchart.py", line 177, in createNode
    node = self.library.getNodeType(nodeType)(name)
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\examples\FlowchartCustomNode.py", line 106, in __in
it__
    CtrlNode.__init__(self, name, terminals=terminals)
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\flowchart\library\common.py", line 97, in __init__
    self.ui, self.stateGroup, self.ctrls = generateUi(ui)
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\flowchart\library\common.py", line 51, in generateU
i
    w.setOpts(**o)
  File "D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64
\lib\site-packages\pyqtgraph\widgets\SpinBox.py", line 160, in setOpts
    raise TypeError("Invalid keyword argument '%s'." % k)
TypeError: Invalid keyword argument 'range'.
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/FlowchartCustomNode.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 This example demonstrates writing a custom Node subclass for use with flowcharts.
4 
5 We implement a couple of simple image processing nodes.
6 """
7 import initExample ## Add path to library (just for examples; you do not need this)
8 
9 from pyqtgraph.flowchart import Flowchart, Node
10 import pyqtgraph.flowchart.library as fclib
11 from pyqtgraph.flowchart.library.common import CtrlNode
12 from pyqtgraph.Qt import QtGui, QtCore
13 import pyqtgraph as pg
14 import numpy as np
15 
16 app = QtGui.QApplication([])
17 
18 ## Create main window with a grid layout inside
19 win = QtGui.QMainWindow()
20 win.setWindowTitle('pyqtgraph example: FlowchartCustomNode')
21 cw = QtGui.QWidget()
22 win.setCentralWidget(cw)
23 layout = QtGui.QGridLayout()
24 cw.setLayout(layout)
25 
26 ## Create an empty flowchart with a single input and output
27 fc = Flowchart(terminals={
28     'dataIn': {'io': 'in'},
29     'dataOut': {'io': 'out'}    
30 })
31 w = fc.widget()
32 
33 layout.addWidget(fc.widget(), 0, 0, 2, 1)
34 
35 ## Create two ImageView widgets to display the raw and processed data with contrast
36 ## and color control.
37 v1 = pg.ImageView()
38 v2 = pg.ImageView()
39 layout.addWidget(v1, 0, 1)
40 layout.addWidget(v2, 1, 1)
41 
42 win.show()
43 
44 ## generate random input data
45 data = np.random.normal(size=(100,100))
46 data = 25 * pg.gaussianFilter(data, (5,5))
47 data += np.random.normal(size=(100,100))
48 data[40:60, 40:60] += 15.0
49 data[30:50, 30:50] += 15.0
50 #data += np.sin(np.linspace(0, 100, 1000))
51 #data = metaarray.MetaArray(data, info=[{'name': 'Time', 'values': np.linspace(0, 1.0, len(data))}, {}])
52 
53 ## Set the raw data as the input value to the flowchart
54 fc.setInput(dataIn=data)
55 
56 
57 ## At this point, we need some custom Node classes since those provided in the library
58 ## are not sufficient. Each node will define a set of input/output terminals, a 
59 ## processing function, and optionally a control widget (to be displayed in the 
60 ## flowchart control panel)
61 
62 class ImageViewNode(Node):
63     """Node that displays image data in an ImageView widget"""
64     nodeName = 'ImageView'
65     
66     def __init__(self, name):
67         self.view = None
68         ## Initialize node with only a single input terminal
69         Node.__init__(self, name, terminals={'data': {'io':'in'}})
70         
71     def setView(self, view):  ## setView must be called by the program
72         self.view = view
73         
74     def process(self, data, display=True):
75         ## if process is called with display=False, then the flowchart is being operated
76         ## in batch processing mode, so we should skip displaying to improve performance.
77         
78         if display and self.view is not None:
79             ## the 'data' argument is the value given to the 'data' terminal
80             if data is None:
81                 self.view.setImage(np.zeros((1,1))) # give a blank array to clear the view
82             else:
83                 self.view.setImage(data)
84 
85 
86 
87         
88 ## We will define an unsharp masking filter node as a subclass of CtrlNode.
89 ## CtrlNode is just a convenience class that automatically creates its
90 ## control widget based on a simple data structure.
91 class UnsharpMaskNode(CtrlNode):
92     """Return the input data passed through an unsharp mask."""
93     nodeName = "UnsharpMask"
94     uiTemplate = [
95         ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'range': [0.0, None]}),
96         ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'range': [0.0, None]}),
97     ]
98     def __init__(self, name):
99         ## Define the input / output terminals available on this node
100         terminals = {
101             'dataIn': dict(io='in'),    # each terminal needs at least a name and
102             'dataOut': dict(io='out'),  # to specify whether it is input or output
103         }                              # other more advanced options are available
104                                        # as well..
105         
106         CtrlNode.__init__(self, name, terminals=terminals)
107         
108     def process(self, dataIn, display=True):
109         # CtrlNode has created self.ctrls, which is a dict containing {ctrlName: widget}
110         sigma = self.ctrls['sigma'].value()
111         strength = self.ctrls['strength'].value()
112         output = dataIn - (strength * pg.gaussianFilter(dataIn, (sigma,sigma)))
113         return {'dataOut': output}
114 
115 
116 ## To make our custom node classes available in the flowchart context menu,
117 ## we can either register them with the default node library or make a
118 ## new library.
119 
120         
121 ## Method 1: Register to global default library:
122 #fclib.registerNodeType(ImageViewNode, [('Display',)])
123 #fclib.registerNodeType(UnsharpMaskNode, [('Image',)])
124 
125 ## Method 2: If we want to make our custom node available only to this flowchart,
126 ## then instead of registering the node type globally, we can create a new 
127 ## NodeLibrary:
128 library = fclib.LIBRARY.copy() # start with the default node set
129 library.addNodeType(ImageViewNode, [('Display',)])
130 # Add the unsharp mask node to two locations in the menu to demonstrate
131 # that we can create arbitrary menu structures
132 library.addNodeType(UnsharpMaskNode, [('Image',), 
133                                       ('Submenu_test','submenu2','submenu3')])
134 fc.setLibrary(library)
135 
136 
137 ## Now we will programmatically add nodes to define the function of the flowchart.
138 ## Normally, the user will do this manually or by loading a pre-generated
139 ## flowchart file.
140 
141 v1Node = fc.createNode('ImageView', pos=(0, -150))
142 v1Node.setView(v1)
143 
144 v2Node = fc.createNode('ImageView', pos=(150, -150))
145 v2Node.setView(v2)
146 
147 fNode = fc.createNode('UnsharpMask', pos=(0, 0))
148 fc.connectTerminals(fc['dataIn'], fNode['dataIn'])
149 fc.connectTerminals(fc['dataIn'], v1Node['data'])
150 fc.connectTerminals(fNode['dataOut'], v2Node['data'])
151 fc.connectTerminals(fNode['dataOut'], fc['dataOut'])
152 
153 
154 
155 ## Start Qt event loop unless running in interactive mode or using pyside.
156 if __name__ == '__main__':
157     import sys
158     if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
159         QtGui.QApplication.instance().exec_()
160
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/FlowchartCustomNode.py b/examples/FlowchartCustomNode.py
--- a/examples/FlowchartCustomNode.py
+++ b/examples/FlowchartCustomNode.py
@@ -92,8 +92,8 @@
     """Return the input data passed through an unsharp mask."""
     nodeName = "UnsharpMask"
     uiTemplate = [
-        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'range': [0.0, None]}),
-        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'range': [0.0, None]}),
+        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'bounds': [0.0, None]}),
+        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'bounds': [0.0, None]}),
     ]
     def __init__(self, name):
         ## Define the input / output terminals available on this node

{"golden_diff": "diff --git a/examples/FlowchartCustomNode.py b/examples/FlowchartCustomNode.py\n--- a/examples/FlowchartCustomNode.py\n+++ b/examples/FlowchartCustomNode.py\n@@ -92,8 +92,8 @@\n     \"\"\"Return the input data passed through an unsharp mask.\"\"\"\n     nodeName = \"UnsharpMask\"\n     uiTemplate = [\n-        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'range': [0.0, None]}),\n-        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'range': [0.0, None]}),\n+        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'bounds': [0.0, None]}),\n+        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'bounds': [0.0, None]}),\n     ]\n     def __init__(self, name):\n         ## Define the input / output terminals available on this node\n", "issue": "invalid keyword argument 'range'\ntesting on Windows Qt5.5.1/ PyQtgraph github of 20160102, I have the following error on the \"Custom Flowchart Nodes\" test:\n\n```\nUsing PyQt5 (default graphics system)\nQWindowsWindow::setGeometryDp: Unable to set geometry 600x900+480+210 on QWidget\nWindow/'QMainWindowClassWindow'. Resulting geometry:  600x874+480+210 (frame: 8,\n 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 69x69, maximum size: 1677721\n5x16777215).\nUsing PyQt5 (default graphics system)\nD:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\\lib\\sit\ne-packages\\pyqtgraph\\flowchart\\eq.py:11: FutureWarning: comparison to `None` wil\nl result in an elementwise object comparison in the future.\n  e = a==b\nTraceback (most recent call last):\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\examples\\FlowchartCustomNode.py\", line 147, in <mod\nule>\n    fNode = fc.createNode('UnsharpMask', pos=(0, 0))\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\flowchart\\Flowchart.py\", line 177, in createNode\n    node = self.library.getNodeType(nodeType)(name)\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\examples\\FlowchartCustomNode.py\", line 106, in __in\nit__\n    CtrlNode.__init__(self, name, terminals=terminals)\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\flowchart\\library\\common.py\", line 97, in __init__\n    self.ui, self.stateGroup, self.ctrls = generateUi(ui)\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\flowchart\\library\\common.py\", line 51, in generateU\ni\n    w.setOpts(**o)\n  File \"D:\\WinPython\\basedir34\\buildQt5\\winpython-3.4.4.amd64\\python-3.4.4.amd64\n\\lib\\site-packages\\pyqtgraph\\widgets\\SpinBox.py\", line 160, in setOpts\n    raise TypeError(\"Invalid keyword argument '%s'.\" % k)\nTypeError: Invalid keyword argument 'range'.\n```\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThis example demonstrates writing a custom Node subclass for use with flowcharts.\n\nWe implement a couple of simple image processing nodes.\n\"\"\"\nimport initExample ## Add path to library (just for examples; you do not need this)\n\nfrom pyqtgraph.flowchart import Flowchart, Node\nimport pyqtgraph.flowchart.library as fclib\nfrom pyqtgraph.flowchart.library.common import CtrlNode\nfrom pyqtgraph.Qt import QtGui, QtCore\nimport pyqtgraph as pg\nimport numpy as np\n\napp = QtGui.QApplication([])\n\n## Create main window with a grid layout inside\nwin = QtGui.QMainWindow()\nwin.setWindowTitle('pyqtgraph example: FlowchartCustomNode')\ncw = QtGui.QWidget()\nwin.setCentralWidget(cw)\nlayout = QtGui.QGridLayout()\ncw.setLayout(layout)\n\n## Create an empty flowchart with a single input and output\nfc = Flowchart(terminals={\n    'dataIn': {'io': 'in'},\n    'dataOut': {'io': 'out'}    \n})\nw = fc.widget()\n\nlayout.addWidget(fc.widget(), 0, 0, 2, 1)\n\n## Create two ImageView widgets to display the raw and processed data with contrast\n## and color control.\nv1 = pg.ImageView()\nv2 = pg.ImageView()\nlayout.addWidget(v1, 0, 1)\nlayout.addWidget(v2, 1, 1)\n\nwin.show()\n\n## generate random input data\ndata = np.random.normal(size=(100,100))\ndata = 25 * pg.gaussianFilter(data, (5,5))\ndata += np.random.normal(size=(100,100))\ndata[40:60, 40:60] += 15.0\ndata[30:50, 30:50] += 15.0\n#data += np.sin(np.linspace(0, 100, 1000))\n#data = metaarray.MetaArray(data, info=[{'name': 'Time', 'values': np.linspace(0, 1.0, len(data))}, {}])\n\n## Set the raw data as the input value to the flowchart\nfc.setInput(dataIn=data)\n\n\n## At this point, we need some custom Node classes since those provided in the library\n## are not sufficient. Each node will define a set of input/output terminals, a \n## processing function, and optionally a control widget (to be displayed in the \n## flowchart control panel)\n\nclass ImageViewNode(Node):\n    \"\"\"Node that displays image data in an ImageView widget\"\"\"\n    nodeName = 'ImageView'\n    \n    def __init__(self, name):\n        self.view = None\n        ## Initialize node with only a single input terminal\n        Node.__init__(self, name, terminals={'data': {'io':'in'}})\n        \n    def setView(self, view):  ## setView must be called by the program\n        self.view = view\n        \n    def process(self, data, display=True):\n        ## if process is called with display=False, then the flowchart is being operated\n        ## in batch processing mode, so we should skip displaying to improve performance.\n        \n        if display and self.view is not None:\n            ## the 'data' argument is the value given to the 'data' terminal\n            if data is None:\n                self.view.setImage(np.zeros((1,1))) # give a blank array to clear the view\n            else:\n                self.view.setImage(data)\n\n\n\n        \n## We will define an unsharp masking filter node as a subclass of CtrlNode.\n## CtrlNode is just a convenience class that automatically creates its\n## control widget based on a simple data structure.\nclass UnsharpMaskNode(CtrlNode):\n    \"\"\"Return the input data passed through an unsharp mask.\"\"\"\n    nodeName = \"UnsharpMask\"\n    uiTemplate = [\n        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'range': [0.0, None]}),\n        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'range': [0.0, None]}),\n    ]\n    def __init__(self, name):\n        ## Define the input / output terminals available on this node\n        terminals = {\n            'dataIn': dict(io='in'),    # each terminal needs at least a name and\n            'dataOut': dict(io='out'),  # to specify whether it is input or output\n        }                              # other more advanced options are available\n                                       # as well..\n        \n        CtrlNode.__init__(self, name, terminals=terminals)\n        \n    def process(self, dataIn, display=True):\n        # CtrlNode has created self.ctrls, which is a dict containing {ctrlName: widget}\n        sigma = self.ctrls['sigma'].value()\n        strength = self.ctrls['strength'].value()\n        output = dataIn - (strength * pg.gaussianFilter(dataIn, (sigma,sigma)))\n        return {'dataOut': output}\n\n\n## To make our custom node classes available in the flowchart context menu,\n## we can either register them with the default node library or make a\n## new library.\n\n        \n## Method 1: Register to global default library:\n#fclib.registerNodeType(ImageViewNode, [('Display',)])\n#fclib.registerNodeType(UnsharpMaskNode, [('Image',)])\n\n## Method 2: If we want to make our custom node available only to this flowchart,\n## then instead of registering the node type globally, we can create a new \n## NodeLibrary:\nlibrary = fclib.LIBRARY.copy() # start with the default node set\nlibrary.addNodeType(ImageViewNode, [('Display',)])\n# Add the unsharp mask node to two locations in the menu to demonstrate\n# that we can create arbitrary menu structures\nlibrary.addNodeType(UnsharpMaskNode, [('Image',), \n                                      ('Submenu_test','submenu2','submenu3')])\nfc.setLibrary(library)\n\n\n## Now we will programmatically add nodes to define the function of the flowchart.\n## Normally, the user will do this manually or by loading a pre-generated\n## flowchart file.\n\nv1Node = fc.createNode('ImageView', pos=(0, -150))\nv1Node.setView(v1)\n\nv2Node = fc.createNode('ImageView', pos=(150, -150))\nv2Node.setView(v2)\n\nfNode = fc.createNode('UnsharpMask', pos=(0, 0))\nfc.connectTerminals(fc['dataIn'], fNode['dataIn'])\nfc.connectTerminals(fc['dataIn'], v1Node['data'])\nfc.connectTerminals(fNode['dataOut'], v2Node['data'])\nfc.connectTerminals(fNode['dataOut'], fc['dataOut'])\n\n\n\n## Start Qt event loop unless running in interactive mode or using pyside.\nif __name__ == '__main__':\n    import sys\n    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):\n        QtGui.QApplication.instance().exec_()\n", "path": "examples/FlowchartCustomNode.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThis example demonstrates writing a custom Node subclass for use with flowcharts.\n\nWe implement a couple of simple image processing nodes.\n\"\"\"\nimport initExample ## Add path to library (just for examples; you do not need this)\n\nfrom pyqtgraph.flowchart import Flowchart, Node\nimport pyqtgraph.flowchart.library as fclib\nfrom pyqtgraph.flowchart.library.common import CtrlNode\nfrom pyqtgraph.Qt import QtGui, QtCore\nimport pyqtgraph as pg\nimport numpy as np\n\napp = QtGui.QApplication([])\n\n## Create main window with a grid layout inside\nwin = QtGui.QMainWindow()\nwin.setWindowTitle('pyqtgraph example: FlowchartCustomNode')\ncw = QtGui.QWidget()\nwin.setCentralWidget(cw)\nlayout = QtGui.QGridLayout()\ncw.setLayout(layout)\n\n## Create an empty flowchart with a single input and output\nfc = Flowchart(terminals={\n    'dataIn': {'io': 'in'},\n    'dataOut': {'io': 'out'}    \n})\nw = fc.widget()\n\nlayout.addWidget(fc.widget(), 0, 0, 2, 1)\n\n## Create two ImageView widgets to display the raw and processed data with contrast\n## and color control.\nv1 = pg.ImageView()\nv2 = pg.ImageView()\nlayout.addWidget(v1, 0, 1)\nlayout.addWidget(v2, 1, 1)\n\nwin.show()\n\n## generate random input data\ndata = np.random.normal(size=(100,100))\ndata = 25 * pg.gaussianFilter(data, (5,5))\ndata += np.random.normal(size=(100,100))\ndata[40:60, 40:60] += 15.0\ndata[30:50, 30:50] += 15.0\n#data += np.sin(np.linspace(0, 100, 1000))\n#data = metaarray.MetaArray(data, info=[{'name': 'Time', 'values': np.linspace(0, 1.0, len(data))}, {}])\n\n## Set the raw data as the input value to the flowchart\nfc.setInput(dataIn=data)\n\n\n## At this point, we need some custom Node classes since those provided in the library\n## are not sufficient. Each node will define a set of input/output terminals, a \n## processing function, and optionally a control widget (to be displayed in the \n## flowchart control panel)\n\nclass ImageViewNode(Node):\n    \"\"\"Node that displays image data in an ImageView widget\"\"\"\n    nodeName = 'ImageView'\n    \n    def __init__(self, name):\n        self.view = None\n        ## Initialize node with only a single input terminal\n        Node.__init__(self, name, terminals={'data': {'io':'in'}})\n        \n    def setView(self, view):  ## setView must be called by the program\n        self.view = view\n        \n    def process(self, data, display=True):\n        ## if process is called with display=False, then the flowchart is being operated\n        ## in batch processing mode, so we should skip displaying to improve performance.\n        \n        if display and self.view is not None:\n            ## the 'data' argument is the value given to the 'data' terminal\n            if data is None:\n                self.view.setImage(np.zeros((1,1))) # give a blank array to clear the view\n            else:\n                self.view.setImage(data)\n\n\n\n        \n## We will define an unsharp masking filter node as a subclass of CtrlNode.\n## CtrlNode is just a convenience class that automatically creates its\n## control widget based on a simple data structure.\nclass UnsharpMaskNode(CtrlNode):\n    \"\"\"Return the input data passed through an unsharp mask.\"\"\"\n    nodeName = \"UnsharpMask\"\n    uiTemplate = [\n        ('sigma',  'spin', {'value': 1.0, 'step': 1.0, 'bounds': [0.0, None]}),\n        ('strength', 'spin', {'value': 1.0, 'dec': True, 'step': 0.5, 'minStep': 0.01, 'bounds': [0.0, None]}),\n    ]\n    def __init__(self, name):\n        ## Define the input / output terminals available on this node\n        terminals = {\n            'dataIn': dict(io='in'),    # each terminal needs at least a name and\n            'dataOut': dict(io='out'),  # to specify whether it is input or output\n        }                              # other more advanced options are available\n                                       # as well..\n        \n        CtrlNode.__init__(self, name, terminals=terminals)\n        \n    def process(self, dataIn, display=True):\n        # CtrlNode has created self.ctrls, which is a dict containing {ctrlName: widget}\n        sigma = self.ctrls['sigma'].value()\n        strength = self.ctrls['strength'].value()\n        output = dataIn - (strength * pg.gaussianFilter(dataIn, (sigma,sigma)))\n        return {'dataOut': output}\n\n\n## To make our custom node classes available in the flowchart context menu,\n## we can either register them with the default node library or make a\n## new library.\n\n        \n## Method 1: Register to global default library:\n#fclib.registerNodeType(ImageViewNode, [('Display',)])\n#fclib.registerNodeType(UnsharpMaskNode, [('Image',)])\n\n## Method 2: If we want to make our custom node available only to this flowchart,\n## then instead of registering the node type globally, we can create a new \n## NodeLibrary:\nlibrary = fclib.LIBRARY.copy() # start with the default node set\nlibrary.addNodeType(ImageViewNode, [('Display',)])\n# Add the unsharp mask node to two locations in the menu to demonstrate\n# that we can create arbitrary menu structures\nlibrary.addNodeType(UnsharpMaskNode, [('Image',), \n                                      ('Submenu_test','submenu2','submenu3')])\nfc.setLibrary(library)\n\n\n## Now we will programmatically add nodes to define the function of the flowchart.\n## Normally, the user will do this manually or by loading a pre-generated\n## flowchart file.\n\nv1Node = fc.createNode('ImageView', pos=(0, -150))\nv1Node.setView(v1)\n\nv2Node = fc.createNode('ImageView', pos=(150, -150))\nv2Node.setView(v2)\n\nfNode = fc.createNode('UnsharpMask', pos=(0, 0))\nfc.connectTerminals(fc['dataIn'], fNode['dataIn'])\nfc.connectTerminals(fc['dataIn'], v1Node['data'])\nfc.connectTerminals(fNode['dataOut'], v2Node['data'])\nfc.connectTerminals(fNode['dataOut'], fc['dataOut'])\n\n\n\n## Start Qt event loop unless running in interactive mode or using pyside.\nif __name__ == '__main__':\n    import sys\n    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):\n        QtGui.QApplication.instance().exec_()\n", "path": "examples/FlowchartCustomNode.py"}]}