1 1
import nengo
2

3 1
from nengolib.network import Network
4 1
from nengolib.connection import Connection
5

6 1
from nengo import Network as NengoNetwork, Connection as NengoConnection
7

8

9 1
__all__ = ['patch', 'unpatch']
10

11

12 1
def patch(network=True, connection=True):
13
    """Monkey-patches nengolib.Network and/or nengolib.Connection."""
14 1
    if network:
15 1
        nengo.Network = Network
16 1
    if connection:
17 1
        nengo.Connection = Connection
18

19

20 1
def unpatch():
21
    """Resets the effect of patch()."""
22 1
    nengo.Network = NengoNetwork
23 1
    nengo.Connection = NengoConnection

Read our documentation on viewing source code .

Loading